The Generic Web Service From Hell
This week I stumbled upon a pretty serious WTF while reading the specs of the B2B web service of a major european hardware retailer.
We've all already seen an utterly complex SOAP API coming with diarrheal XML schemas and all the compatibility issues one may experience when using different stacks.
Now it looks like someone addressed the strong typing complaint about SOAP in quite an extreme fashion.
The published API consists of a single method, let's call it the MotherOfAllMethods. It has the following signature:
String MotherOfAllMethods(String sessionId, String xmlString)
The second parameter is a complete XML document, using an undocumented custom schema (no DTD, XSD or RELAX in sight, only examples are provided). So Yes, technically speaking, what we are dealing with here is actually XML over XML over HTTP.
Did I mention the function also returns a string which contains an XML document?
Hold on tight, the best is yet to come. Although the API may have only one generic method, the web service actually has several functions. It appears it was slightly too difficult to dispatch the service to the right handler when parsing the content of the xmlString so every function has its own URL... with it's very own WSDL, all describing the same MotherOfAllMethods. I highly doubt that design choice was made to make the whole thing a bit more RESTful...
That means that a different SOAP client proxy has to be built for every function supported by the one method API. Brilliant.
Can you imagine that whoever designed that has SOAP in his/her resume?
Scary stuff.

