Adam worked for a moving company. When he joined up, it was a regional enterprise with several locations and a surprisingly large fleet of trucks. One day, he came to work to learn that he now worked for a much larger, national company, called ConHugeCo. Nobody was getting fired, but now Adam had to get their data integrated with ConHugeCo’s.

ConHugeCo had a fat middleware tier built in WebSphere MQ. Like any true enterprise solution, everything was glued together by XML, and that meant Adam built many small programs that pulled data from legacy systems and spreadsheets and mashed it into XML files, which were then shipped off to the MQ system. Adam had the HR and insurance data synced within a few days, but when it came time to sync their loadouts for moving large items, things started to get weird.

The schema and documentation and sample code provided by ConHugeCo told Adam to build a document that looked like this:

<equipment_to_load>  
    <number_of_pieces>2</number_of_pieces>   
    <van_size>53</van_size>   
    <nbr_pads>0</nbr_pads>   
    <nbr_straps>0</nbr_straps>   
    <bubble_wrap>N</bubble_wrap>   
    <item_info>  
        <equipment_description>Item 1</equipment_description>   
        <size_length>5</size_length>   
        <size_width>5</size_width>   
        <size_height>2</size_height>   
    </item_info>  
    <item_info>  
        <equipment_description>Item 2</equipment_description>   
        <size_length>5</size_length>   
        <size_width>4</size_width>   
        <size_height>5</size_height>   
    </item_info>  
</equipment_to_load >

Adam did exactly that, but when he checked the results, “Item 2” had never been added to the system. Adam assumed that he had some mistake in his document. He validated it against the schema, made sure it was clear of non-printing characters, double-checked the character-encoding, and confirmed he was sending it to the right destination.

Nothing looked wrong, so he called the WebSphere MQ team lead at ConHugeCo. “Well, nobody else is having any issues,” the lead said. “Obviously you’re doing something wrong.”

“Well, yes,” Adam said, “but I don’t know what. Could you look at my XML?”

The lead wasn’t terribly interested in pitching in, but Adam managed to convince him that fixing the problem was the quickest way to get Adam out of his hair. “Your document structure must be wrong,” the lead said. “The error we get is that you’re missing an equipment to load section.”

“Um… but it’s there.”

“Obviously, it isn’t, otherwise MQ wouldn’t be complaining about it.”

Since getting more information from the lead was like getting blood from a piano, Adam decided to do some experimenting. Since MQ claimed it was missing an equipment_to_load section, Adam added another one:

<equipment_to_load>  
    <number_of_pieces>30000000</number_of_pieces>  
    <van_size>-12</van_size>  
</equipment_to_load >  
<equipment_to_load>  
    <number_of_pieces>2</number_of_pieces>   
    <van_size>53</van_size>   
    <nbr_pads>0</nbr_pads>   
    <nbr_straps>0</nbr_straps>   
    <bubble_wrap>N</bubble_wrap>   
    <item_info>  
        <equipment_description>Test 1</equipment_description>   
        <size_length>5</size_length>   
        <size_width>5</size_width>   
        <size_height>2</size_height>   
    </item_info>  
    <item_info>  
        <equipment_description>Test 2</equipment_description>   
        <size_length>5</size_length>   
        <size_width>4</size_width>   
        <size_height>5</size_height>   
    </item_info>  
</equipment_to_load >

That document worked just fine. And a little more experimentation showed that so long as he had as many equipment_to_load elements as he had item_info elements, the document worked. It wasn’t valid, according to the schema, and all of the values in the first n equipment_to_load elements were ignored, but it worked.

With that figure out, Adam had one final question: how did he submit corrections to the documentation? “The documentation is correct,” the MQ lead replied, “you’re the only one that’s ever had a problem with this.”

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!