Sunday, May 6, 2007

Translate Webservice 100% functional

My mission to complete and deploy a SOAP webservice for my GoogleTranslateEngine is finally complete. I had it partially working a month ago, but for several weeks I've been trying to understand why the jBossWS stack insisted on sending me garbage for non-latin encodings.

My friend Dustin had insisted that I write some unit tests, and that ended up being a very good thing. I have been doing all my development with eclipse on a windows XP machine, and the unit tests were all passing perfectly. The webservice is running under jBoss on a fedora core 6 box. Because I'm using maven as my build system, it's trivial to do builds/tests on any other system, but I never though to run my unit tests on my linux box, I simply assumed they would work like they did on windows.

When I finally got around to doing it, one of my unit tests was failing. As it turns out I wasn't setting my encoding parameters properly when passing my InputStream into the tagSoup parser. For some reason that I still don't understand, this was working just fine on windows, but not at all on linux.

So, the point of this story is, don't be shy with unit tests. They can be very helpful!

I just released version 0.9.2 of the Google Translate Engine which can be found on my software page. This, of course, includes the bug fix that I mentioned.

The glorious SOAP webservice that I've been working on is published here. I'm keeping it open for now, unless a deluge of people start using it, but I don't think I have much to worry about.

So my next project will to be a restlet implementation. This looks like the way of the future, so until next time...