- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
Outch!
Still I would prefer dealing with the "XML" than with the..., hum what can we call this thing anyway?
Admin
At some point, you have to acknowledge that the problem is not the interface. It's the vendor.
Admin
Is it bad that that XML is a lot better than some of the vendors I have to deal with on a day to day basis?
At least it's broken up and not
<content> ...Enormous blob of data... </content>
Admin
IDGI
Admin
I don't get it. Is the WTF that he searched for Jacob but got Marlene?
Or is it that although he can get a XML response, he still has to submit the request in a fixed width format?
Admin
I wrote a spec almost identical to this - as a joke, an April Fool's day prank.
I'm starting to wonder if somebody saw that prank and either (a) posted it here, assuming it was real, or (b) actually thought it was a great design and implemented it, leaving some poor schmuck of a client to deal with the mess.
Admin
Look at the content of the XML file...
Admin
You ask for XML, you get XML. What's the problem?
Admin
LOL, "well-formed XML".
Admin
I'm assuming it's because they have a list of fields instead of the tag name being the field name. Not really the best WTF on here.
Admin
Maybe it's that all the data items are tagged "value"?
The request format is great... without any parameter names, the vendor is free to change the API whenever they want!
Admin
"Kid With A Hammer" Syndrome. See a "new" technology, and try to wrap it around everything you are already doing, without truly understanding the technology.
I think that one look at the XML proves it. "Hey! Check it out! We are using XML now, and everyone will LOVE it because it is the way to exchange data!"
Just because it is well-formed, or even valid, does not mean that it is correct!
Admin
What is the WTF here?
Admin
Admin
Well, as WTF-esque as the fixed width WebRequest is, translating that XML into something genuinely usable is a programming challenge of Coding Challenge proportions. Say "Great! Thanks, now don't touch it" to the vendor, hope like hell they don't pull the rug out from under you, knock up a parser-converter to deal with the XML and sprinkle it with comments:
// XML de-stupid-ifier // Dirty little secret: dont even ask
for people who might stumble across it.
Admin
The fixed-width string of parameters is the worst wtf I've seen in a while, but the XML could be much worse. They should have structured it better instead of using the 'toXML' function in whatever SQL server they're using, but you can still get at it with XPath
To get all the 'LAST NAME' values: /result/data/row/value[position() = /result/fields/field[string() = 'LAST NAME']/position()]
(get all the value elements whose 'position' is the same at the 'LAST NAME' field element's position)
Convoluted, but works and can be maintained...
Admin
Apart from the backwards formatting of a request, the response - in this case in XML is XML for XMLs sake, and is fairly useless for querying as the markup is that of a table, and not that of a data set (attributes, or meaningful elements are not used).
That is the WTF - it isn't a leg slapper, but c'mon chaps.
Admin
I feel sorry for anyone whose first name is that long and ends with a J.
Admin
I'm not an expert, but I believe the xml return should have been more like this:
And not with the descriptors of each field as their own values.
Admin
Oh man, that's awful. Clearly the vendor has proven themselves to be incompentent but I bet you're locked in, for whatever reason, am I right? Well Diego, an old friend used to tell me "no matter how far down the wrong road you've gone, turn back". Sound advice there.
Admin
The XML is just the 'toXML' or some such output from some database server.
I was going to guess MYSQL, but I just looked and MYSQL's format is different. It's not MSSQL or Postgres either.... don't know what it is.
Admin
No, I was not trying to say that using "value" for everything is the real WTF... I was just tacking on another possibility to your list.
Admin
Go Diego Go!!
Admin
With a nice XSLT file you can probably transform these responses into pretty meaningful xml without too much effort.
Admin
Mainframe mindset. sigh
Admin
The real WTF is that the vendor still uses punched cards!
Admin
The WTF is that Diego did not ask Dora to get her handy dandy backpack and map to find directions to the vendors location and beat the living snot out of them.
Admin
Admin
Admin
The author started by discussing the query side, and ended by discussing the response side.
And the vendor didn't even discuss an XML formatted request!
All they said was "if the first character of the Web Request is an X, then the results will be returned in XML"
TRWTF is that Diego may have had to submit
just to get the "well-formed XML" response shown.
Admin
I suspect it's an idiot
Admin
Hah, I know a very large supplier of credit files (yes, one of the big 3) who had a very very similar request format to this. It was called fixed-input format and there were entire huge documents on how to request different products using it. That's what happens when you have old mainframe systems and no proper middleware to handle requests.
Admin
Actually, he tried. However, he was in such a bad mood already, that when map sang "I'm the map" for the 18th time in a row, Diego set him on fire
Admin
No argument that this service's API is terrible and misses the point of Web Services and XML completely, but it at least seems well-documented and predictable.
I'd expect any competent programmer to be able to create a wrapper API for the request that constructs their terrible request string from a set of meaningful, separate parameters, and one that converts their terrible fixed-width response data (remember, the XML format is "undocumented") into a sane representation of the data set.
Also, what is a "proprietary TCP protocol"?
Admin
Yeah, but their way really simplifies the schema.
Admin
Your documentation is incomplete.
// For full details, see http://thedailywtf.com/Articles/WellFormed-XML.aspx
(My comment was declared to be spam. Ummm . . . okay. First time it has happened to me. See many complaints about it happening to other people, but this is my first time experiencing it.)
Admin
now this is not a well-formed xml. you can't put space in the tag name.
Admin
Wouldn't surprise me if it is Oracle. That thing has enough WTFs to fill a month of WTFs on this site.
Admin
And once again, I'm left with the impression that, no matter what the "enterprise software developer" job listing says, anybody with two brain cells to rub together is grossly overqualified for the position.
Admin
Fixed width data structures are okay. Look at TCP/IP related protocols if you think they're obsolete! They're far more efficient and far less error-prone than any form of variable-length parameter passing, even if "new generation" script language programmers aren't used to them.
The incompatibility here is between a script writer and a systems programmer.
The XML was "interesting", but XML is the work of script language writers anyway ;-)
(NB. Efficient: no parsing required, no associative array overhead - just read and write to the same point in a buffer. Error-prone: you can't get buffer over-run problems with a fixed-length buffer, nor can you get memory leaks from dynamically allocating to cope with unknown data sizes).
Admin
Anybody ever look at the itunes xml file?
I assume it's some poor conversion from a database, but damn that's stupid xml.
Admin
And? When we come across this in the real world, we just wrap it with a saner interface and then forget about it.
public String SearchWebRequest(String firstName, String lastName, String state) { return WebRequest(SomeUtils.printf("SRCH%-25s%-20s%-10s", firstName, lastName, state)); }
Admin
Looks like a straight interface to IBM IMS to me.
Runs away screaming
Admin
Yup. Give the man a cookie.
Same with the useless XML. It's not useless if you write a parser. Yes, it defeats the purpose of XML, but hey.. XML sometimes defeats the purpose of XML.
Admin
Typically means anything that uses sockets directly on one of the non-priviliged ports.
Admin
All the data is wrapped in a nondescript <field> tag. In doing this the meaning of each element is unknown.
It should have been something like:
<return schema="person-record"> <name> <first>John</first> <last>Hancock</last> </name> <ssn>111223333</ssn> <street>123 Lane</street> <city>city name</city> ... </return>Admin
Heh, I can do better, I've recently had to deal with:
<content> .... Base 64 encoded XML file... </content>
Annoyingly, both the containing XML and the XML it contains are well defined and well thought out.
Admin
Well-formed XML? Isn't that an oxymoron?
At least it's better than the alternative...
Admin
You know what? I read the article, and there were zero comments. "Ok" I thought, "let me do a frist post". Then I typed exactly the same as above - BUT (and this is a big but that differentiates us) then it occurred to me how lame that would be, so I passed.
Ha! How lame of you!