Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: SOAP::LITE and umlauts = Binary??

by Anonymous Monk
on Sep 02, 2009 at 12:39 UTC ( #792898=note: print w/replies, xml ) Need Help??


in reply to SOAP::LITE and umlauts = Binary??

perl soapumlaut.pl |xml_pp
#!/usr/bin/perl -- use strict; use warnings; use SOAP::Lite; use SOAP::Lite 0.65 +trace => 'debug'; use Encode; print SOAP::Lite->new->serializer->envelope( method => 'DreamT', ## xsd:base64Binary # SOAP::Data->new(City => q!Säffle!), # SOAP::Data->name( "City" => encode('UTF-8',q!Säffle!)), ## not well-formed (invalid token) # SOAP::Data->type("xsd:string")->name( "City" => q!Säffle!), ## perfect SOAP::Data->type("xsd:string")->name( "City" => encode('UTF-8', +q!Säffle!)), ); __END__ <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/enc +oding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns: +soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http:/ +/www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSche +ma-instance"> <soap:Body> <DreamT> <City xsi:type="xsd:string">Säffle</City> </DreamT> </soap:Body> </soap:Envelope>

Replies are listed 'Best First'.
Re^2: SOAP::LITE and umlauts = Binary??
by DreamT (Pilgrim) on Sep 02, 2009 at 13:09 UTC
    Thank you! That ALMOST made my day..:-)
    I'm outputting the debug data to a textfile. When I use the utf-8 encoding i Get
    <City xsi:type="xsd:string">Säffle</City>

    and when I disable it I get this
    <City xsi:type="xsd:string">Säffle</City>

    Is this because of the logfile itself, or will it look like this when I post it into the webservice? The Logfile itself is created with Perl and gets populated with CGI::Carp.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://792898]
help
Chatterbox?
[ambrus]: Corion: ah, so you want a library that parses HTTP, and you want to do the IO yourself, and don't want a full AnyEvent wrapper.
[ambrus]: Corion: I think I parsed a HTTP header from a string with LWP once. You can definitely use that to create a HTTP message too. The problme is
[ambrus]: that if you do that, you'd have to find where each HTTP response ends, which is nontrivial if you want persistent connections (essential for performance if you have small requests).
[Corion]: ambrus: Yes, ideally an API that I feed the incoming data piece by piece and that I can ask "is that response done" and "what should I do next" and "please construct the appropriate redirect for me"
[Corion]: ambrus: Yes, ideally the module would do all that nasty stuff for me and give me a way to ask it what the current situation is
[ambrus]: Corion: you could also consider using some wrapper over the multi interface of curl, I think Net::Curl might be a good one, since implementing enough of what it expects from the event loop might be easier than a full AnyEvent interface.

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (16)
As of 2016-12-07 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (130 votes). Check out past polls.