Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 38368 invoked from network); 2 Feb 2005 17:05:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Feb 2005 17:05:56 -0000 Received: (qmail 8288 invoked by uid 500); 2 Feb 2005 17:05:43 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 8276 invoked by uid 500); 2 Feb 2005 17:05:43 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 8261 invoked by uid 99); 2 Feb 2005 17:05:43 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from msw.bowstreet.com (HELO bst-ms02.bowstreet.com) (66.151.239.15) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Feb 2005 09:05:42 -0800 Received: from pobox1.bowstreet.com (POBOX1 [10.10.1.137]) by bst-ms02.bowstreet.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Wed, 2 Feb 2005 12:01:48 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: UTF-8 char issue with 1.2RC2 ? Date: Wed, 2 Feb 2005 12:05:39 -0500 Message-ID: <615216BF4368BE4AA210E017DE6997D7DDDE65@pobox1.bowstreet.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: UTF-8 char issue with 1.2RC2 ? Thread-Index: AcUJSWuhoMQy3qi6QvKguQ7NL0D7Bw== From: "Mike Burati" To: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I was looking into an issue a coworker ran into calling the Xmethods = Babelfish translation service (specifically to test out non-ascii = chars), and decided to try a simple WSDL2Java based client against the = service to see how it compared to how he was using AXIS (1.2RC2), and I = was able to reproduce nearly the same problem. =20 I figured I'd ask here before digging too deep on this one - hoping that = maybe someone can spot either what I'm doing wrong or what the service = itself is doing wrong, or what may be a bug in 1.2RC2? I'm sure I've = seen non-ascii chars work just fine in AXIS response envelopes before, = so I'm not sure what's up with this one... =20 WSDL: http://www.xmethods.net/sd/2001/BabelFishService.wsdl =20 Service is at: http://services.xmethods.net:80/perl/soaplite.cgi =20 Sample request envelope =20 en_frI'm going to the = beach. =20 Sample response envelope: =20 je vais =E0 la plage = = With an HTTP content type header of: Content-Type: text/xml; charset=3Dutf-8 The AXIS Fault I'm getting back in the simple WSDL2Java generated client = (unit test hand-modified to just run as a standalone client without = Junit) is slightly different than what my coworker is getting, but both = are the same below Message.getSOAPEnvelope in the stack, where it's = trying to parse the XML for the SOAP envelope in both cases, via the = DeserializationContext for the response envelope. =20 The encoding for the response envelope is marked UTF-8 as is the HTTP = response headers associated with that envelope. The envelope looks = fairly valid by eye and a simple Java program that just posted the above = request to the same service and read and dumped out the response using a = UTF-8 encoding didn't complain about any of the bytes in the response. Note: I don't get the error if the response contains just ascii chars. =20 Here's one exception I'm getting in the standalone test (MustUnderstand = checker asks for the SOAP env): =20 {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: = Character conversion error: "Malformed UTF-8 char -- is an XML = encoding declaration missing?" (line number may be too low). at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100) at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072) at = org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEnti= ty.java:914) at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1048) at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:520) at org.apache.crimson.parser.Parser2.parse(Parser2.java:318) at = org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442) at javax.xml.parsers.SAXParser.parse(SAXParser.java:345) at = org.apache.axis.encoding.DeserializationContext.parse(DeserializationCont= ext.java:226) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645) at org.apache.axis.Message.getSOAPEnvelope(Message.java:424) And here's another another almost identical one from another batch of = client code using AXIS directly (without WSDL2Java) AxisFault faultCode: = {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.io.UTFDataFormatException: Invalid byte 2 of 3-byte = UTF-8 seq uence. faultActor: faultNode: faultDetail: = {http://xml.apache.org/axis/}stackTrace:java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence. at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown = Source) at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown = Source) at = org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unk nown Source) at = org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent Dispatcher.dispatch(Unknown Source) at = org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown = Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown = Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown = Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at = org.apache.axis.encoding.DeserializationContext.parse(Deserialization Context.java:226) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:645) at org.apache.axis.Message.getSOAPEnvelope(Message.java:424) at = org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnders tandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:173) at org.apache.axis.client.Call.invokeEngine(Call.java:2719) at org.apache.axis.client.Call.invoke(Call.java:2702) at org.apache.axis.client.Call.invoke(Call.java:2378) at org.apache.axis.client.Call.invoke(Call.java:2301) at org.apache.axis.client.Call.invoke(Call.java:1758)