Monday, April 30, 2007

webservice pain

I wish I could proudly announce that I have a slick new webservice for my Google Translator ready for public consumption. It's been almost a month since I started working on the thing in my free time. This should have been a relatively straight-forward project to implement, but alas, it's been hell every step of the way. SOAP is hard and ugly, and plenty of people warned me about it before I even started. "Use REST!!", they proclaimed, and now I can see why.

I started off on my journey with the intention of making a nice POJO backed JSR-109 style webservice. The SEI was fairly trivial, and it works much like the RMI version that I did earlier. Once you have your interface done, there isn't any more coding to do, it's all xml wiring, mapping, and magic. Which is far nastier than it should be.

My first mistake was trying to attack the problem in a generic way. Before you get started on a webservice, know what your target platform is and read the container specific documentation/examples. My target platform is jBoss 4.0.5. I would have saved myself a great deal of time and pain if I had started off on with the jBossWS examples.

The reason your platform choice is so important is because of the tooling. Your platform will most likely provide some set of tools for generating all the nasty XML files that JSR-109 demands (jax-rpc mapping, WSDL, etc). jBossWS comes with a little tool called wstool which takes a pretty simple xml config file and then spits out all the ugly XML files that you need for your webservice. Having to generate these files by hand would give you nightmares, so good tooling is essential. I also had to download and use the now out of date JWSDP-2.0 for several things, including wscompile (more tooling).

Once all that was done, everything worked, well almost. As long as no non-latin character encodings were involved, everything was just peachy. If, however, I want to translate English to Russian, and get UTF-8 Cyrillic returned to me, things don't work so well. Somewhere inside the jBossWS code, it's mangling up my result string, and that's going to take some poking around. Hopefully I'll figure everything out and get the thing to behave correctly.

So, maybe next month?

Wednesday, April 11, 2007

The joys of FIOS

So there I was, all moved into the new house and excited about finally getting verizon fios data services and fiosTV. I would love to tell you about the gross incompetence i had to deal with while using the verizon avenue DSL service, but that's a whole other story. Back to fios, for the average joe, all you have to do is call up their residential services, place an order, wait for the tech to come out, and your set.

Myself, and probably anyone who reads this blog, wouldn't fall in to the average joe category, and that's where the pain begins. I like serving web accessible stuff from servers at my home office. It's cheaper than a using colo, and if something critical goes boom, I'm not driving 30 miles to my colo in my pajamas. I like to be close to my hardware.

After placing my residential order for everything, I discovered that the residential fios data service, blocks all inbound traffic on ports 25 and 80. Of course, I should have researched this before I placed my order, but I like living dangerously, or it could be that I'm just lazy about that kind of thing.

Verizon, with an abundance of marketing genius, has determined that if you need inbound web traffic, then you must be a business, and should be forced to get a static IP, even though you might not need one. I guess they have never heard of dynamic DNS. You have to order it through their business services, which is a totally separate department.

Annoying, but easily remedied by a call to their office...

So they canceled my residential order, and after 30 minutes we've got my new business service order in place, the tech will come out on April 9th. I'm all happy, right up until the part where I say, "Great! l'd also like to setup fiosTV now too." Lo and behold, because I use the business service with a static IP, they refuse to sell me fiosTV. I demand to know why, and it's not because of any technical limitation. The reason is that the marketing wizards have determined that if your a business, then you probably have a lot of employees, and you shouldn't be able to provide cheap fiosTV to them, instead you have to get some business directTV package which probably has an astronomical price tag. I guess verizon has never heard of a home office either.

So here I am a couple weeks later, I have nice speedy fios data service, but I'm reduced to using rabbit ears on all my TV's until I figure out what kind of cable/satellite setup will suit my needs.

Fios is a good deal faster than DSL, no complaints in the speed department. The router they give you is pretty damn nice too. However, I still haven't been able to setup my outbound email, because it requires some kind of user/password that they failed to mention to me at any point during this entire process.

Well, at least I can get back to coding, who needs TV.