• (cs)
    <?xml version="1.0" encoding="iso-8859-1" ?> 
    <result>
      <fields>
        <field>COMMENT</field>
      </fields>
      <data>
        <row>
          <value>frist</value>
        </row>
      </data>
    </result>
    
  • Sylver (unregistered)

    Outch!

    Still I would prefer dealing with the "XML" than with the..., hum what can we call this thing anyway?

  • Arancaytar (unregistered)

    At some point, you have to acknowledge that the problem is not the interface. It's the vendor.

  • Drew (unregistered)

    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>

  • DSR (unregistered)

    IDGI

  • Neville Flynn (unregistered)

    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?

  • (cs)

    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.

  • Trefex (unregistered) in reply to Neville Flynn
    Neville Flynn:
    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?

    Look at the content of the XML file...

  • (cs)

    You ask for XML, you get XML. What's the problem?

  • anonymousse (unregistered)

    LOL, "well-formed XML".

  • kjordan (unregistered) in reply to frits
    frits:
    You ask for XML, you get XML. What's the problem?

    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.

  • (cs) in reply to Neville Flynn
    Neville Flynn:
    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?

    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!

  • (cs)

    "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!

  • <tag><comment>WTF</comment></tag> (unregistered) in reply to kjordan

    What is the WTF here?

  • Neville Flynn (unregistered) in reply to @Deprecated
    @Deprecated:
    Neville Flynn:
    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?

    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!

    Ahh, I see. I'm not that good with XML. Maybe the vendor has a job for me!
  • Inglourious Cowerd (unregistered)

    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.

  • (cs)

    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...

  • Incourcful (unregistered)

    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.

  • (cs)

    I feel sorry for anyone whose first name is that long and ends with a J.

  • (cs) in reply to frits

    I'm not an expert, but I believe the xml return should have been more like this:

      <name>MARLENE</name>
      <last name>RUTH</last name>
      <mother maiden name>DE MARCO</mother maiden name>
      <birthdate>1973-02-24 00:00:00</birthdate>
    

    And not with the descriptors of each field as their own values.

  • Anonymous (unregistered)

    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.

  • (cs) in reply to beldred

    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.

  • (cs) in reply to Neville Flynn
    Neville Flynn:
    @Deprecated:
    Neville Flynn:
    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?

    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!

    Ahh, I see. I'm not that good with XML. Maybe the vendor has a job for me!

    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.

  • Paula (unregistered)

    Go Diego Go!!

  • Kempeth (unregistered) in reply to jonnyq
    jonnyq:
    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...

    I agree. They didn't really get the idea behind xml but judging from the parameter structure I'd wager their non-xml version would be much worse.

    With a nice XSLT file you can probably transform these responses into pretty meaningful xml without too much effort.

  • (cs)

    Mainframe mindset. sigh

  • Dennis (unregistered)

    The real WTF is that the vendor still uses punched cards!

  • bl@h (unregistered)

    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.

  • ParkinT (unregistered) in reply to MyKey_
    MyKey_:
    <?xml version="1.0" encoding="iso-8859-1" ?> 
    <result>
      <fields>
        <field>COMMENT</field>
      </fields>
      <data>
        <row>
          <value>frist</value>
        </row>
      </data>
    </result>
    
    Now that is clever!
  • Neville Flynn (unregistered) in reply to bl@h
    bl@h:
    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.
    You, sir, win at teh internets.
  • THG (unregistered) in reply to DSR
    DSR:
    IDGI

    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

    WebRequest("XSRCH                   JACOB              NY             ")
    

    just to get the "well-formed XML" response shown.

  • SR (unregistered) in reply to jonnyq
    jonnyq:
    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.

    I suspect it's an idiot

  • Yardik (unregistered)

    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.

  • (cs) in reply to bl@h
    bl@h:
    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.

    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

  • Rootbeer (unregistered)

    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"?

  • (cs) in reply to beldred
    beldred:
    I'm not an expert, but I believe the xml return should have been more like this:
      <name>MARLENE</name>
      <last name>RUTH</last name>
      <mother maiden name>DE MARCO</mother maiden name>
      <birthdate>1973-02-24 00:00:00</birthdate>
    

    And not with the descriptors of each field as their own values.

    Yeah, but their way really simplifies the schema.

  • (cs) in reply to Inglourious Cowerd
    Inglourious Cowerd:
    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.

    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.)

  • yzaf (unregistered) in reply to beldred
    beldred:
    I'm not an expert, but I believe the xml return should have been more like this:
      <name>MARLENE</name>
      <last name>RUTH</last name>
      <mother maiden name>DE MARCO</mother maiden name>
      <birthdate>1973-02-24 00:00:00</birthdate>
    

    And not with the descriptors of each field as their own values.

    now this is not a well-formed xml. you can't put space in the tag name.

  • Jonathan Wilson (unregistered) in reply to jonnyq

    Wouldn't surprise me if it is Oracle. That thing has enough WTFs to fill a month of WTFs on this site.

  • NewbiusMaximus (unregistered)

    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.

  • Frank Leonhardt (unregistered)

    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).

  • KeithLM (unregistered)

    Anybody ever look at the itunes xml file?

    <key>452</key>
    <dict>
    	<key>Track ID</key>integer>452</integer>
    	<key>Name</key><string>Little Monk</string>
    	<key>Artist</key><string>Barenberg, Russ</string>
            <key>Album Artist</key><string>Barenberg, Russ</string>
            <key>Album</key><string>When At Last</string>
    	<key>Genre</key><string>Country</string>
            <key>Kind</key><string>MPEG audio file</string>
    ...
    

    I assume it's some poor conversion from a database, but damn that's stupid xml.

  • OMGWTFJON (unregistered)

    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)); }

  • Mainframe refugee (unregistered)

    Looks like a straight interface to IBM IMS to me.

    Runs away screaming

  • Yardik (unregistered) in reply to OMGWTFJON
    OMGWTFJON:
    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)); }

    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.

  • Anonymouse (unregistered) in reply to Rootbeer
    Rootbeer:
    Also, what is a "proprietary TCP protocol"?

    Typically means anything that uses sockets directly on one of the non-priviliged ports.

  • hash check (unregistered) in reply to <tag><comment>WTF</comment></tag>
    <tag><comment>WTF</comment></tag>:
    What is the WTF here?
    The XML file is the WTF.

    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>
  • FIA (unregistered) in reply to Drew
    Drew:
    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>

    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.

  • Sanderman (unregistered)

    Well-formed XML? Isn't that an oxymoron?

    At least it's better than the alternative...

  • (cs) in reply to MyKey_
    MyKey_:
    <?xml version="1.0" encoding="iso-8859-1" ?> 
    <result>
      <fields>
        <field>COMMENT</field>
      </fields>
      <data>
        <row>
          <value>frist</value>
        </row>
      </data>
    </result>
    

    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!

Leave a comment on “Well-Formed XML”

Log In or post as a guest

Replying to comment #:

« Return to Article