Strong vs. Loosely Typed and Web Services


Posted

in


I found out something about myself last night.  I’ve worked in many programming languages in many environments over the years.  I love loosely typed languages such as PHP, Perl, Python, and other scripting languages.  It’s so easy to get stuff done without having to deal with plumbing and details.  At the same time, I find myself frustrated when debugging these loosely typed languages.  I find myself wanting to go back to Java, C#, or other languages where I have to specifiy what I want.  It’s more work, but when I can deal with concrete structs and variables that aren’t going to be changing type based on context, I feel much better.

This applies even more when working with web services.  The scripting-like languages are great for simple implemenations of web services.  They’re great for examples.  It’s so easy to say, “Grab the info from this web service, and then print whatever comes back.”  But when I’m trying to get at just a specific nugget of information, the pseudostructarrays that I’ve had to deal with cause my head to spin.

I’ve also noticed that loosely typed languages make no so perfect web services servers.  They’re great for simple clients, as I’ve stated before, but most of the client/server implementations in these scripting languages dont’t support WSDL or other advanced features, moreso in SOAP than XML-RPC.

I’ve found that Cook Computings XML-RPC.NET has made my life a lot easier on the XML-RPC client side.  It allows me to work in any Visual Studio .NET language, though most of my time has been spent in C# lately.  I have to create structs.  Data is passed back and forth in these structs.  I know what’s going on.  I don’t have to figure out what the heck I’m doing wrong that caused a parse error on line 28.

Any discussion of debugging web services is not complete without mentioning both Simon Fell’s TCPTrace and Mindreef’s SOAPScope.  Both of these utilities allow you to see exactly what XML is passing over the wire.  TCPTrace is basic and free.  Mindreef’s product is worth every penny that they charge for it.  It has a slick UI, coverts XML over the wire into pseudocode (great big picture stuff), and has advanced logging and other crazy stuff that I can’t recall at the moment.  If you’re getting paid to write and debug web services, buy SOAPScope.

I’m glad I learned what I learned about myself last night.  I may not be the best programmer on the planet because I can’t deal with some of this stuff.  But that’s okay.  I’m sure if I was pair programming or working with a team of developers, someone would say something to make it all click.  Someday.