Re: SoapException character encoding
- From: Marvin Smit <marvin.smit@xxxxxxxxx>
- Date: Mon, 19 Sep 2005 12:02:02 +0200
Hi Dadi,
Just got back from 'another week abroad'.. hence the late reply.
Is there any change you can send the string (as it should be) in a
binary format? (not loosing the special char). This way i could try &
test some myself.
Marvin Smit.
On Thu, 8 Sep 2005 08:55:03 -0700, "Dadi"
<Dadi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>Hi,
>
>> Does this fail on the general exception being expected or the specific
>> message in the fault?
>
>It fails when I do Assert.AreEqual("...réttindi...", soapException.Message).
>
>> Since NUnit is a .Net implementation, and therefor uses the CLR
>> defined characters & strings (very close to UNICode 3.0), you will
>> have to use the "original fault message" in your ExpectedException
>> attribute. What i mean by this is the "native way of writing that text
>> in .Net".
>>
>> r + (ALT+223) + ttindi = "r¯ttindi"
>
>You mean something like Assert.AreEqual("...r&#233;ttindi...",
>soapException.Message)?
>
>> (Here we see that the newsgroups do not have the correct codepage to
>> display the character. In binary format however, this is still the
>> Chr(223). Unicode however generally uses more than 1 byte to encode a
>> character.
>>
>> The easiest thing to do probably is; Generate the error using a
>> sample/test app. Grab the XML Unescaped text from the fail and
>> copy-paste that in your NUnit ExpectedException attribute.
>
>I don´t follow - the string I get from SoapException.Message _is_ XML
>escaped, not unescaped?!!?
>
>> >In the meantime I´m using HttpUtility.Decode to get my test to pass.
>>
>> Although it obviously circumvented your issue, it is not the
>> appropriate API for this. The string we're discussing is XML escaped,
>> not HTTP encoded.
>
>I realize this and I only resorted to this as a temporary solution.
>
>> If you retrieve the fault info (message) from the
>> exception, it will be XML unescaped.
>>
>> When using this, the exception class on the client side will have the
>> correct text in the node.
>
>The behaviour you describe here does not match my experience. We must not be
>understanding each other here?
>
>Thanks again,
>Dadi.
>
>> On Thu, 8 Sep 2005 03:14:03 -0700, "Dadi"
>> <Dadi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> >Hi Marvin,
>> >
>> >I´m currently testing this web service with NUnit and my assertion fails due
>> >to this problem. By your account, should the characters not be unescaped in
>> >the test too?
>> >
>> >In the meantime I´m using HttpUtility.Decode to get my test to pass.
>> >
>> >TIA,
>> >Dadi
>> >
>> >"Marvin Smit" wrote:
>> >
>> >> Hi,
>> >>
>> >> The reason for it being XML escaped is that those characters are not
>> >> allowed 'natively' in XML text nodes. (just like the < changes into
>> >> <). The encoding you see here is the 'Unicode Character Encoding'
>> >> being used.
>> >>
>> >> réttindi => r + UniCodeChar(223) + ttindi
>> >>
>> >> On the other side (client), this text will be XML Unescaped. Therefore
>> >> this format is only 'on the wire'.
>> >>
>> >> As long as the Client can display those characters, there should be no
>> >> problem.
>> >>
>> >> Hope this helps,
>> >>
>> >> Marvin Smit.
>> >>
>> >> On Wed, 7 Sep 2005 04:35:08 -0700, "Dadi"
>> >> <Dadi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>> >>
>> >> >Hi,
>> >> >
>> >> >My native language is Icelandic and I´m making a web service that returns
>> >> >results that contain many Icelandic characters. This works fine, however,
>> >> >when I return a soap:Fault, the string in the faultstring element has the
>> >> >Icelandic characters encoded like "réttindi", where "é" is an
>> >> >Icelandic accented character.
>> >> >
>> >> >Does anyone know why? If so, how do I deal with this?
>> >> >
>> >> >Best regards,
>> >> >Dadi.
>> >>
>> >>
>>
>>
.
- References:
- SoapException character encoding
- From: Dadi
- Re: SoapException character encoding
- From: Marvin Smit
- Re: SoapException character encoding
- From: Dadi
- Re: SoapException character encoding
- From: Marvin Smit
- Re: SoapException character encoding
- From: Dadi
- SoapException character encoding
- Prev by Date: Re: No return from async web service call
- Next by Date: Re: <****Result>
- Previous by thread: Re: SoapException character encoding
- Next by thread: Re: Updating Web References in .NET 2003
- Index(es):
Relevant Pages
|