Tuesday, December 2, 2008

WS-Deathstar how I hate thee



Long ago, in a web far, far away Microsoft brought us .NET SOAP (JAVA the Hut was also part of the SOAP movement) propagating WS-* ("Deathstar") principles and practices.

The WSDL entered into SOA giving some developers strongly typed web service implementations rapidly. The WSDL was not a requirement to have a SOAP endpoint, but it made it really easy for .NET apps to consume .NET web services.

Anyone who has ever implemented an API and opened it up for public consumption knows that the interface contract typically rules the roost, so-to-speak. It impacts everything from when you version, what is open to the consumers, content returned by your API, and so on...

When the interface changes on your API, with out a solid versioning architecture, your consumers will, and do hurl curses at you and your API (and would probably seek alternatives).

So, back to the "Deathstar" - Years ago I dropped a .NET web service out into the smelting pot to be consumed by all. I made many mistakes but refined / fixed it as much as I could without killing my consumers - WS-* made it pretty easy to make "big mistakes." One such mistake that I made was that I never set the namespace on the service.

[WebService()] <--bad
[WebService(Namespace="http://sub.domain.suffix")]
<--good

I basically forgot to do it, and once I realized it - my consumers we're eating tempuri soup and I was feeling a bit like a clown. There is no silver bullet to fix what is currently out there without forcing consumers to change code - I will live with that mistake there to remind me look before I leap.

lesson learned: Set my namespaces on my SOAP web services before they make it to production, or don't use the "Deathstar."

No comments:

Post a Comment