16 January 2007

Back from Web Services Hell

Well, what a long, strange, nasty, standards-ridden trip it's been! I started working on my WS project, using NetBeans and the Sun app server (aka the Glassfish Project). Everything's fine, I'm able to create a web service, deploy it on the server, create a WSDL file, create a test client, everything happy little web-service developers do. Obviously, things were going too well. So I get ready to make the service available to a third-party company we're working with. Since I can't just stick my development machine outside the firewall, I find out where we deploy our other web services. Well, it turns out all of our other web services are written in either .NET (our "approved" development platform) or LotusScript. Obviously, neither of these were going to work. However, we had a couple of legacy apps that were written in Java, so there was an app server available, it just wasn't accessible to outside users. I was assured that opening a hole in the firewall wouldn't be a problem, so I should just go ahead and test my service and once it was ready they'd open it up. OK, sounds good, I thought, and handed over a copy of my WAR file. "Oh, we can't use that." Um, what? "We need an EAR file." My blinking was met with a blank stare. OK, fine, whatever, it is but the work of a moment to create an EAR file that has my WAR file in it. I hand it over to the powers that be (who are really pretty good developers, but not sysadmins) and ask that they let me know when it's been deployed.

A couple of minutes later, I get a log file. A big one.

Seems our app server only supports Java up to version 1.4.2 (yeah, three guesses which one that is...), and I made heavy use of JAX-WS (which uses JSR-181 annotations, all of which are part of Java 1.5). Being the clever, resourceful person I am, I immediately went bitching to my manager. Turns out that even the latest version of The App Server That Time Forgot didn't support Java 1.5. However, as soon as I started looking, I discovered that they were releasing a new new version, which allegedly did support 1.5. So I downloaded it and immediately discovered that its support was pretty much limited to running 1.4.2 apps on a 1.5 JVM ("No JEE 5 support for you!").

So I got a copy of the popular open-source IDE that the app server company bases its tools on. Turns out the IDE doesn't have a "server profile" for the new new app server version, so it wasn't able to talk to it (even though it supported the new release, and the new new version was a minor release of that). So I got the "toolkit" that was supposed to work with the new new version. Turns out it didn't support JAX-WS. So I got the Web Services clip-on/extension/module. Turns out it was only mostly compatible with JAX-WS (full compatibility coming RSN). It further turns out that once the Web Services c/e/m was installed, the toolkit was only marginally compatible with the app server.

So I fudged and poked and tweaked and Googled and grepped and read and read and read. I loaded updates, I loaded patches, I got beta code, I got alpha code, I got third-party code. I got add-ons and clip-ons and extensions and modules. Finally, I caught myself humming "One Piece at at Time" by Johnny Cash, and that's when I decided it wasn't going to work.

Hmmmm, what to do, what to do... Do I scrap my current implementation and step back to those golden days of yesteryear and rewrite my code using JAX-RPC interface semantics? Or do I take that idle Oracle server I built and put the Sun app server on it and have them stick that out in the open? A quick conversation with my VP and it all started falling into place. It boiled down to the fact that I was proposing we use hardware we already owned, so we didn't have to coordinate with anyone else, and it was an already-proven solution. I was a month past my original "I could probably write this in a week or so" estimate, so expediency ruled the day and we did the deed. I was able to finish the work quickly once that was done (Total time creating web service with four methods: 2.5 wks. Total time trying to figure out how to make it work on app server X: 3 wks.).

I just deployed the service yesterday, and I'm waiting for the "We can't use this — it's just what we asked for!" call. Guess I'll just cement the curse by writing up the documentation...

1 comment:

klenwell said...

So I fudged and poked and tweaked and Googled and grepped and read and read and read. I loaded updates, I loaded patches, I got beta code, I got alpha code, I got third-party code. I got add-ons and clip-ons and extensions and modules. Finally, I caught myself humming "One Piece at at Time" by Johnny Cash, and that's when I decided it wasn't going to work.

Ha! Love that song and love that description.