Article View: microsoft.public.xml.soap
Article #2Re: Character encoding in SOAP-message
From: Joe Fawcett
Date: Tue, 03 Apr 2007 07:16
Date: Tue, 03 Apr 2007 07:16
55 lines
3034 bytes
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'><?xml version="1.0" encoding="ISO-8859-1"?><vraag xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="c:\\source\\test\\xml\ \query.xsd"> <Special character: �>BRN</bron></ vraag></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
Technical Details
Message-ID:
<Op$Uw$bdHHA.3648@TK2MSFTNGP05.phx.gbl>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!out04b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!nx02.iad01.newshosting.com!newshosting.com!newshub.sdsu.edu!msrtrans!TK2MSFTFEEDS01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP05.phx.gblReferences:
<1175501188.146830.74710@p77g2000hsh.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10aac8,2d705d9391d4c101 X-Google-Thread: 114096,2d705d9391d4c101 X-Google-Attributes: gid10aac8,gid114096,public X-Google-Language: ENGLISH,ASCII From: "Joe Fawcett" <joefawcett@newsgroup.nospam> References: <1175501188.146830.74710@p77g2000hsh.googlegroups.com> Subject: Re: Character encoding in SOAP-message Date: Tue, 3 Apr 2007 08:16:01 +0100 Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Message-ID: <Op$Uw$bdHHA.3648@TK2MSFTNGP05.phx.gbl> Newsgroups: microsoft.public.xml.soap,borland.public.delphi.webservices.soap NNTP-Posting-Host: 85.118.9.34 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!out04b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!nx02.iad01.newshosting.com!newshosting.com!newshub.sdsu.edu!msrtrans!TK2MSFTFEEDS01.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP05.phx.gbl