Crouching tiger, coding monkey

.Net web service moving faster than light

Filed under: .Net, C#, Web service — Grant April 10, 2007 @ 11:31 pm

So yesterday I got an email from Matt the CIO saying that he needed me to swing by to see him. I didn’t really think that much about it except that I was SUPER glad that I had decided not to host a bunch of bootleg DVD torrents on my corporate computer.

I had taken a day of vacation so this morning I rolled down to his office to see what was going on.

Me (pointing at his desk): That looks like a router right there.

Matt: It’s a switch.

Me: I don’t think it’s going to do much sitting right there.

Matt: I’m still configuring it.

Me: You should just make it dumb hub, this switch business is just a fad.

Matt: We don’t let you configure much on the network do we?

Me: Notsomuch.

Matt: *Nods approvingly* So anyway, we need to update the FTL Drive Guidance Transmogrifier to run as a web service so we can use it from a few different places.

Me: Just running it as a DLL like we have it currently isn’t going to work?

Matt: No, we’ll want to centralize it, use this network we have to its potential.

Me: But putting something critical like the FTL Drive Guidance Transmogrifier on the network is suicide! Don’t you remember that’s how the Cylons penetrated the fleet’s defenses?

Matt: That was a TV show you realize?

Me: Frak you man! This is all crazy talk!

Matt: If that’s how you feel I can disconnect your ports from the internet, just so the fake shiny robots don’t infiltrate your computer.

Me: I’ll go ahead start making the code changes.

Now, the last time I wrote a web service it was in C++, and really basic C++ at that. So there was no fancy schmancy integrated toolkits just a heaping helping of pain in the arse.

But, since this was all on Windows and Microsoft has been pushing .Net web services as the greatest thing since DCOM, err I mean CORBA, I figured it should be snap. Plus I’d get to use C# so I could just new, new, new as much as I wanted. It would be the digital equivalent of eating french fries wrapped in bacon without having to worry about a massive cardiac incident.

It turns out it was that easy, just a new project, some incredibly straightforward glue code to tie the new service to the existing DLL and I was rolling. I haven’t got the client code written yet but the .Net debugger interface shows it all working like a champ. (What I wouldn’t have given for that for that C++ web service. I would have given up both the fries and the bacon without thinking about it.)

I’m sure somewhere in California a tear is running down the cheek of a certain black mock turtleneck wearing executive because of my .Net/C#/web service praise. At the same time I’m also sure that somewhere else there is an evil looking robot with a red eye pulsing in anticipation. Too bad that the side that is happy has loads of nuclear weapons. Frak.

cylon.png

2 Comments »

  1. Now you’ll have to update your toolbox. The first thing that happens when you start to do web services is that everyone will blame you when something doesn’t work. Naturally, you’ll want to blame them for an incorrect request. Something like Wireshark (nee Ethereal) is invaluable in this area. Setting the capture filter to the port your services are running on and the display filter to syns or acks will usually let you find the right request the quickest. While that one can handle https, it’s a bear. Covelight ClearWatch (not ClearHTTP, at least I don’t think) makes watching https downright easy at least for Windows boxes. Or you can use one of them fancy SOAP Management proxies that will capture every request and response.
    Then comes the whole thing around the services themselves. I vote for SOAP only if necessary, WSDL first, make sure it’s encapsulated, atomic and reusable.
    Well, that’s what I have for now. Good luck!

    Comment by Sean — April 13, 2007 @ 11:08 am

  2. [...] even ten hours after I complimented ASP.Net it has already come back to haunt [...]

    Pingback by Crouching tiger, coding monkey » Grant.JinxedSelf() == true — November 6, 2007 @ 1:53 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment