Solved

Webservices & Babelfish Error

Posted on 2006-11-14
3
343 Views
Last Modified: 2013-12-24
I'm just starting to play around with webservices and an AJAX call to a cfc and have run into an issue with babelfish which appears to be a bug with the service but I'm wondering if it's an issue with something i'm doing wrong

This bit works
<cfset transstring = "My text. To provide many people an opportunity to try some food and have some fun. Those with ears will like it too. Another friend wanted some things and I"

but
<cfset transstring = "My text. To provide many people an opportunity to try some food and have some fun. Those with ears will like it too. Another friend wanted some things and I thought"

fails because the first occurrence of an accent character returned is in pensé the translation of the last word "thought".

length of the text doesn't seem to matter

<cfset transstring = "i would like to go swimming in the pool"> works

<cfset transstring = "i would like to go swimming in the summer"> fails (été)  



the error returned is

"    Could not perform web service invocation "BabelFish".
 Here is the fault returned when invoking the web service operation:

AxisFault

 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence.
 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(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configu... </pre>


the code in the cfc is

<cfinvoke
  webservice = "http://www.xmethods.net/sd/2001/BabelFishService.wsdl"
  method = "BabelFish"
  returnVariable = "translated">

<cfinvokeargument name="translationmode" value="en_fr" />
<cfinvokeargument name="sourcedata" value="#transstring#" />
</cfinvoke>

ca anyone replicate this...

anyone have any workarounds if it is a bug...


0
Comment
Question by:SidFishes
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
trailblazzyr55 earned 500 total points
ID: 17942408
I'm not sure, I tried this myself and got the same error, I also went to a site that used the babel fish web service for sample translation and it choked on the same strings your's had problems with. However I couldn't find anything in relation to setting an encoding so you could return a translation without an error. I have a feeling it's a limit to the web service or at least a free version, haven't used it too much myself to know more or if there's a different version with that fixed...

~trail
0
 
LVL 36

Author Comment

by:SidFishes
ID: 17942719
what i figured...frustrating though as a translation webservice that can't handle characters created by the translation (duh) is somewhat pointless...I'll leave the q open and see if anyone else has ideas.
0
 
LVL 36

Author Comment

by:SidFishes
ID: 17947257
It's not a bug, it's a feature!  whee...

https://issues.apache.org/jira/browse/AXISCPP-964

apparently it works fine when the web service server is running OS/400 but oops...nothing else as there is no appropriate translation step...

ah well...

pts to trail for taking the time to verify
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question