🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: microsoft.public.xml.soap
5 messages
5 total messages Started by berryv Mon, 02 Apr 2007 08:06
Character encoding in SOAP-message
#1
Author: berryv
Date: Mon, 02 Apr 2007 08:06
42 lines
2834 bytes
Hi all,

We have a soap webservice built with Delphi 6.
The service has a funcion with three string-paramaters, one of which
is used to pass xml-data.

The service gets called by another party who uses Uniface to call our
webservice.
They get the following error when special character are used (like
"ë"):
"<SOAP-ENV:faultstring>An invalid character was found in text
content."

When I call the service with a testtool built with D6, I can use such
characters and no problem occurs.

So, the call doesn't get past the soap-middelware.

Here's an axample of a call, wich, when called from my machine gives
no error:

<?xml version='1.0' encoding='ISO-8859-1'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/
envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAP-
ENC='http://schemas.xmlsoap.org/soap/encoding/'>
<SOAP-ENV:Body SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/
encoding/'>
<NS1:echoAdvies xmlns:NS1='urn:adviesIntf-Iadvies'>
<username xsi:type='xsd:string'>test</username>
<password xsi:type='xsd:string'>test</password>
<query xsi:type='xsd:string'>&lt;?xml version=&quot;1.0&quot;
encoding=&quot;ISO-8859-1&quot;?&gt;&lt;vraag xmlns:xsi=&quot;http://
www.w3.org/2001/XMLSchema-instance&quot;
xsi:noNamespaceSchemaLocation=&quot;c:\\source\\test\\xml\
\query.xsd&quot;&gt; &lt;Special character: ë&gt;BRN&lt;/bron&gt;&lt;/
vraag&gt;</query>
</NS1:echoAdvies>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Any ideas?
Re: Character encoding in SOAP-message
#2
Author: Joe Fawcett
Date: Tue, 03 Apr 2007 07:16
55 lines
3034 bytes
<berryv@gmail.com> wrote in message 
news:1175501188.146830.74710@p77g2000hsh.googlegroups.com...
Hi all,

We have a soap webservice built with Delphi 6.
The service has a funcion with three string-paramaters, one of which
is used to pass xml-data.

The service gets called by another party who uses Uniface to call our
webservice.
They get the following error when special character are used (like
"�"):
"<SOAP-ENV:faultstring>An invalid character was found in text
content."

When I call the service with a testtool built with D6, I can use such
characters and no problem occurs.

So, the call doesn't get past the soap-middelware.

Here's an axample of a call, wich, when called from my machine gives
no error:

<?xml version='1.0' encoding='ISO-8859-1'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/
envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:SOAP-
ENC='http://schemas.xmlsoap.org/soap/encoding/'>
<SOAP-ENV:Body SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/
encoding/'>
<NS1:echoAdvies xmlns:NS1='urn:adviesIntf-Iadvies'>
<username xsi:type='xsd:string'>test</username>
<password xsi:type='xsd:string'>test</password>
<query xsi:type='xsd:string'>&lt;?xml version=&quot;1.0&quot;
encoding=&quot;ISO-8859-1&quot;?&gt;&lt;vraag xmlns:xsi=&quot;http://
www.w3.org/2001/XMLSchema-instance&quot;
xsi:noNamespaceSchemaLocation=&quot;c:\\source\\test\\xml\
\query.xsd&quot;&gt; &lt;Special character: �&gt;BRN&lt;/bron&gt;&lt;/
vraag&gt;</query>
</NS1:echoAdvies>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Any ideas?

Errors like that normally mean that the encoding declared in the XML, 
'ISO-8859-1', in this case is not the actual encoding used. How do you 
specify the encoding in your service. I would suggest changing the 
decalration to UTF-16 or UTF-8 anyway, why restrict yourselves?

-- 

Joe Fawcett (MVP - XML)

http://joe.fawcett.name
Re: Character encoding in SOAP-message
#3
Author: berryv
Date: Wed, 04 Apr 2007 11:13
29 lines
2718 bytes
On Apr 3, 9:16 am, "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote:
> Errors like that normally mean that the encoding declared in the XML,
> 'ISO-8859-1', in this case is not the actual encoding used. How do you
> specify the encoding in your service. I would suggest changing the
> decalration to UTF-16 or UTF-8 anyway, why restrict yourselves?
>

Thank you for answering.

I've used a sniffer to see what actually goes over the line. I've uses
different clients to test it. Using Perl I managed to reproduce the
problem.
When I use Perl (Soap::Lite) I can set the encoding. When I set the
encoding to ISO-8859-1 the client generates an http request with in
it's request-header this ISO encoding. The acual message (the soap-
envelope) uses ISO-encoding (I can see the codes using the sniffer).
This client generates no error. When I set the encoding to utf-8 the
http header states utf-8. The actual message, though, is encoded in
ISO. This version gives the soap-error.

When I use a javascript-client, I can set the http-header to ISO and
to utf-8. Both versions, however, code their content in uft-8!?!
Neither one of these clients gives an error. It seems that the
receiving soap-server knows which encoding is used, but it doesn't
look at the request-header. How can the server tell which encoding is
used?

Thanks.
Berry
Re: Character encoding in SOAP-message
#4
Author: Joe Fawcett
Date: Thu, 05 Apr 2007 15:53
42 lines
3026 bytes
I'm not sure as I don't know much about Delphi or your web server.
If it ignores the request header for the encoding then it must be working it 
out from the actual file, reading the first few characters and deciding.
Does that mean it's working now or do you still have a problem?

-- 

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

<berryv@gmail.com> wrote in message 
news:1175685227.545085.53250@y66g2000hsf.googlegroups.com...
> On Apr 3, 9:16 am, "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote:
>> Errors like that normally mean that the encoding declared in the XML,
>> 'ISO-8859-1', in this case is not the actual encoding used. How do you
>> specify the encoding in your service. I would suggest changing the
>> decalration to UTF-16 or UTF-8 anyway, why restrict yourselves?
>>
>
> Thank you for answering.
>
> I've used a sniffer to see what actually goes over the line. I've uses
> different clients to test it. Using Perl I managed to reproduce the
> problem.
> When I use Perl (Soap::Lite) I can set the encoding. When I set the
> encoding to ISO-8859-1 the client generates an http request with in
> it's request-header this ISO encoding. The acual message (the soap-
> envelope) uses ISO-encoding (I can see the codes using the sniffer).
> This client generates no error. When I set the encoding to utf-8 the
> http header states utf-8. The actual message, though, is encoded in
> ISO. This version gives the soap-error.
>
> When I use a javascript-client, I can set the http-header to ISO and
> to utf-8. Both versions, however, code their content in uft-8!?!
> Neither one of these clients gives an error. It seems that the
> receiving soap-server knows which encoding is used, but it doesn't
> look at the request-header. How can the server tell which encoding is
> used?
>
> Thanks.
> Berry
> 
Re: Character encoding in SOAP-message
#5
Author: berryv
Date: Thu, 05 Apr 2007 17:32
18 lines
2438 bytes
On 5 apr, 17:53, "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote:
> I'm not sure as I don't know much about Delphi or your web server.
> If it ignores the request header for the encoding then it must be working it
> out from the actual file, reading the first few characters and deciding.
> Does that mean it's working now or do you still have a problem?

I still have the problem. I've compared the http-contents. It seems
that the http-header goes over the line first., then the actual
content goes over the line. The content  can have a different
character-encoding than the header. The first few bytes of the content
are binary-data. Maybe that's how the server knows the encoding used.
With my perl-testclient I can workt around the problem, but the party
who's connecting to our soapserver does not (for the moment, that is.
Their main developer is on vacation this week. He'll be back next
week. Then I'll ask him if he can alter the http-header to see if that
helps).

Berry
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads