Webservices, mangled umlauts due to encoding

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Webservices, mangled umlauts due to encoding

Thomas Brodt
I have a problem with the decoding of german umlauts in SOAP messages
for a webservice call.

Below are two messages. The upper one doesn't define a charset, the
lower one defines charset utf-8 in the header. The upper one has mangled
the german umlauts (Äöà what should be ÄöÜ) while the lower one shows
them correctly. Both define the same WS message invocation, though.

The content of both SOAP messages define <?xml version="1.0"
encoding="UTF-8"?>, but the content doesn't seem to be read in UTF-8
when the message is unmarshalled.
Shouldn't the content of the SOAP messages be read according to its own
encoding which may differ from that of the header?
Currently we have this issue with vw7.6, but jun10.11 doesn't help, so
maybe there is something wrong in general with either the processing in
vw or the invocation style from an external app?

I'm quite ignorant what concerns those internals of the whole WS theory,
so any comments are welcome.

Thomas




POST /plem HTTP/1.1
Host: 127.0.0.1:28548
Accept: */*
Accept-language: de-ch
Soapaction: ""
Content-type: text/xml
Accept-encoding: gzip,deflate
User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64;
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
3.0.30729; Media Center PC 6.0; FDM; OfficeLiveConnector.1.5;
OfficeLivePatch.1.3; .NET4.0C)
Content-length: 350
Connection: Keep-Alive
Cache-control: no-cache

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><Anmelden
xmlns="urn:PLEMClientWebServicePragmas"><Benutzerkontext><Benutzer>ÄöÜ</Benutzer><Kennwort>äöü</Kennwort></Benutzerkontext></Anmelden></soap:Body></soap:Envelope>



POST /plem HTTP/1.1
Host: 127.0.0.1:28548
Accept: */*
Accept-language: de-ch
Soapaction: ""
Content-type: text/xml;charset=UTF-8
Accept-encoding: gzip,deflate
User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64;
Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
3.0.30729; Media Center PC 6.0; FDM; OfficeLiveConnector.1.5;
OfficeLivePatch.1.3; .NET4.0C)
Content-length: 380
Connection: Keep-Alive
Cache-control: no-cache

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><Stationsbild
xmlns="urn:PLEMClientWebServicePragmas"><Benutzerkontext><Benutzer>ÄöÜ</Benutzer><Kennwort>äöü</Kennwort></Benutzerkontext><Stationsbildkontext/></Stationsbild></soap:Body></soap:Envelope>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Webservices, mangled umlauts due to encoding

Claus Kick
The RFC 1341 says:

7.1.1     The charset parameter

A critical parameter that may be specified in  the  Content-
Type  field  for  text  data  is the character set.  This is
specified with a "charset" parameter, as in:


 Content-type: text/plain; charset=us-ascii


Unlike some  other  parameter  values,  the  values  of  the
charset  parameter  are  NOT  case  sensitive.   The default
character set, which must be assumed in  the  absence  of  a
charset parameter, is US-ASCII.


So, if all works in adherence to this RFC, then US-ASCII is assumed if no charset is stated.


-- 
Claus Kick

"Wenn Sie mich suchen: Ich halte mich in der Nähe des Wahnsinns auf. 
Genauer gesagt auf der schmalen Linie zwischen Wahnsinn und Panik. 
Gleich um die Ecke von Todesangst, nicht weit weg von Irrwitz und Idiotie."

"If you are looking for me: I am somewhere near to lunacy. 
More clearly, on the narrow path between lunacy and panic. 
Right around the corner of  fear of death, 
not far away from idiocy and insanity."

-----Ursprüngliche Nachricht-----
Von: Thomas Brodt <[hidden email]>
Gesendet: 13.07.2010 11:50:03
An: VW-Dev <[hidden email]>,VWNC <[hidden email]>
Betreff: [vwnc] Webservices, mangled umlauts due to encoding

>I have a problem with the decoding of german umlauts in SOAP messages
>for a webservice call.
>
>Below are two messages. The upper one doesn't define a charset, the
>lower one defines charset utf-8 in the header. The upper one has mangled
>the german umlauts (Äöà what should be ÄöÜ) while the lower one shows
>them correctly. Both define the same WS message invocation, though.
>
>The content of both SOAP messages define <?xml version="1.0"
>encoding="UTF-8"?>, but the content doesn't seem to be read in UTF-8
>when the message is unmarshalled.
>Shouldn't the content of the SOAP messages be read according to its own
>encoding which may differ from that of the header?
>Currently we have this issue with vw7.6, but jun10.11 doesn't help, so
>maybe there is something wrong in general with either the processing in
>vw or the invocation style from an external app?
>
>I'm quite ignorant what concerns those internals of the whole WS theory,
>so any comments are welcome.
>
>Thomas
>
>
>
>
>POST /plem HTTP/1.1
>Host: 127.0.0.1:28548
>Accept: */*
>Accept-language: de-ch
>Soapaction: ""
>Content-type: text/xml
>Accept-encoding: gzip,deflate
>User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64;
>Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
>3.0.30729; Media Center PC 6.0; FDM; OfficeLiveConnector.1.5;
>OfficeLivePatch.1.3; .NET4.0C)
>Content-length: 350
>Connection: Keep-Alive
>Cache-control: no-cache
>
><?xml version="1.0" encoding="UTF-8"?>
><soap:Envelope
>xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><Anmelden
>xmlns="urn:PLEMClientWebServicePragmas">ÄöÜ</Benutzer><Kennwort>äöü</Kennwort></Benutzerkontext></Anmelden></soap:Body></soap:Envelope>
>
>
>
>POST /plem HTTP/1.1
>Host: 127.0.0.1:28548
>Accept: */*
>Accept-language: de-ch
>Soapaction: ""
>Content-type: text/xml;charset=UTF-8
>Accept-encoding: gzip,deflate
>User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64;
>Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR
>3.0.30729; Media Center PC 6.0; FDM; OfficeLiveConnector.1.5;
>OfficeLivePatch.1.3; .NET4.0C)
>Content-length: 380
>Connection: Keep-Alive
>Cache-control: no-cache
>
><?xml version="1.0" encoding="UTF-8"?>
><soap:Envelope
>xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><Stationsbild
>xmlns="urn:PLEMClientWebServicePragmas">ÄöÜ</Benutzer><Kennwort>äöü</Kennwort></Benutzerkontext></Stationsbild></soap:Body></soap:Envelope>
>
>_______________________________________________
>vwnc mailing list
>[hidden email]
>http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Webservices, mangled umlauts due to encoding

Holger Kleinsorgen-4
In reply to this post by Thomas Brodt
http://www.w3.org/TR/soap12-part0/#L26866

"When placing SOAP messages in HTTP bodies, the HTTP Content-type header
must be chosen as "application/soap+xml" [RFC 3902]. (The optional
charset parameter, which can take the value of "utf-8" or "utf-16", is
shown in this example, but if it is absent the character set rules for
freestanding [XML 1.0] apply to the body of the HTTP request.)"


> I'm quite ignorant what concerns those internals of the whole WS theory,
> so any comments are welcome.
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

FW: Webservices, mangled umlauts due to encoding

Kogan, Tamara
In reply to this post by Thomas Brodt
Based on  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/ the message below was encoded and sent as Soap 1.1 message:

POST /plem HTTP/1.1
        Host: 127.0.0.1:28548
        Soapaction: ""
        Content-type: text/xml;charset=UTF-8
        Accept-encoding: gzip,deflate
..
       
        <?xml version="1.0" encoding="UTF-8"?>
        <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

Soap 1.1 expects content type header as:
Content-Type: text/xml; charset="utf-8"

http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383539


Tamara Kogan
Smalltalk development,
Cincom Systems
 

 

> On 07/13/2010 05:50 AM, Thomas Brodt wrote:
>
>
> I have a problem with the decoding of german umlauts in
> SOAP messages for a webservice call.
>
> Below are two messages. The upper one doesn't define a
> charset, the lower one defines charset utf-8 in the header.
> The upper one has mangled the german umlauts (Äöà what
> should be ÄöÜ) while the lower one shows them correctly. Both
> define the same WS message invocation, though.
>
> The content of both SOAP messages define <?xml
> version="1.0" encoding="UTF-8"?>, but the content doesn't
> seem to be read in UTF-8 when the message is unmarshalled.
> Shouldn't the content of the SOAP messages be read
> according to its own encoding which may differ from that of
> the header?
> Currently we have this issue with vw7.6, but jun10.11
> doesn't help, so maybe there is something wrong in general
> with either the processing in vw or the invocation style from
> an external app?
>
> I'm quite ignorant what concerns those internals of the
> whole WS theory, so any comments are welcome.
>
> Thomas
>
>
>
>
> POST /plem HTTP/1.1
> Host: 127.0.0.1:28548
> Accept: */*
> Accept-language: de-ch
> Soapaction: ""
> Content-type: text/xml
> Accept-encoding: gzip,deflate
> User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows
> NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET
> CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; FDM;
> OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4.0C)
> Content-length: 350
> Connection: Keep-Alive
> Cache-control: no-cache
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> <http://schemas.xmlsoap.org/soap/envelope/>
> ><soap:Body><Anmelden
> xmlns="urn:PLEMClientWebServicePragmas"><Benutzerkontext><Benu
> tzer>ÄöÜ</Benutzer><Kennwort>äöü</Kennwort></Benutzerkon
> text></Anmelden></soap:Body></soap:Envelope>
>
>
>
> POST /plem HTTP/1.1
> Host: 127.0.0.1:28548
> Accept: */*
> Accept-language: de-ch
> Soapaction: ""
> Content-type: text/xml;charset=UTF-8
> Accept-encoding: gzip,deflate
> User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows
> NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET
> CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; FDM;
> OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4.0C)
> Content-length: 380
> Connection: Keep-Alive
> Cache-control: no-cache
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> <http://schemas.xmlsoap.org/soap/envelope/>
> ><soap:Body><Stationsbild
> xmlns="urn:PLEMClientWebServicePragmas"><Benutzerkontext><Benu
> tzer>ÄöÜ</Benutzer><Kennwort>äöü</Kennwort></Benutzerkontext><
Stationsbildkontext/></Stationsbild></soap:Body></soap:Envelope>
>
>
>
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: FW: Webservices, mangled umlauts due to encoding

Thomas Brodt
I had to chew a while until I understood (sort of) the information from
the links. But I think I got it.

Thanks to all who answered!

Thomas


Am 13.07.2010 15:38, schrieb Kogan, Tamara:

> Based on  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/ the message below was encoded and sent as Soap 1.1 message:
>
> POST /plem HTTP/1.1
> Host: 127.0.0.1:28548
> Soapaction: ""
> Content-type: text/xml;charset=UTF-8
> Accept-encoding: gzip,deflate
> ..
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>
> Soap 1.1 expects content type header as:
> Content-Type: text/xml; charset="utf-8"
>
> http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383539
>
>
> Tamara Kogan
> Smalltalk development,
> Cincom Systems
>
>
>
>    
>> On 07/13/2010 05:50 AM, Thomas Brodt wrote:
>>
>>
>> I have a problem with the decoding of german umlauts in
>> SOAP messages for a webservice call.
>>
>> Below are two messages. The upper one doesn't define a
>> charset, the lower one defines charset utf-8 in the header.
>> The upper one has mangled the german umlauts (Äöà what
>> should be ÄöÜ) while the lower one shows them correctly. Both
>> define the same WS message invocation, though.
>>
>> The content of both SOAP messages define<?xml
>> version="1.0" encoding="UTF-8"?>, but the content doesn't
>> seem to be read in UTF-8 when the message is unmarshalled.
>> Shouldn't the content of the SOAP messages be read
>> according to its own encoding which may differ from that of
>> the header?
>> Currently we have this issue with vw7.6, but jun10.11
>> doesn't help, so maybe there is something wrong in general
>> with either the processing in vw or the invocation style from
>> an external app?
>>
>> I'm quite ignorant what concerns those internals of the
>> whole WS theory, so any comments are welcome.
>>
>> Thomas
>>
>>
>>
>>
>> POST /plem HTTP/1.1
>> Host: 127.0.0.1:28548
>> Accept: */*
>> Accept-language: de-ch
>> Soapaction: ""
>> Content-type: text/xml
>> Accept-encoding: gzip,deflate
>> User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows
>> NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET
>> CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; FDM;
>> OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4.0C)
>> Content-length: 350
>> Connection: Keep-Alive
>> Cache-control: no-cache
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <soap:Envelope
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>> <http://schemas.xmlsoap.org/soap/envelope/>
>>      
>>> <soap:Body><Anmelden
>>>        
>> xmlns="urn:PLEMClientWebServicePragmas"><Benutzerkontext><Benu
>> tzer>ÄöÜ</Benutzer><Kennwort>äöü</Kennwort></Benutzerkon
>> text></Anmelden></soap:Body></soap:Envelope>
>>
>>
>>
>> POST /plem HTTP/1.1
>> Host: 127.0.0.1:28548
>> Accept: */*
>> Accept-language: de-ch
>> Soapaction: ""
>> Content-type: text/xml;charset=UTF-8
>> Accept-encoding: gzip,deflate
>> User-agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows
>> NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET
>> CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; FDM;
>> OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4.0C)
>> Content-length: 380
>> Connection: Keep-Alive
>> Cache-control: no-cache
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <soap:Envelope
>> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
>> <http://schemas.xmlsoap.org/soap/envelope/>
>>      
>>> <soap:Body><Stationsbild
>>>        
>> xmlns="urn:PLEMClientWebServicePragmas"><Benutzerkontext><Benu
>> tzer>ÄöÜ</Benutzer><Kennwort>äöü</Kennwort></Benutzerkontext><
>>      
> Stationsbildkontext/></Stationsbild></soap:Body></soap:Envelope>
>    
>>
>>
>>
>>
>>      
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>    
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc