TFS, SOAP and XMLish

time to read 13 min | 2538 words

Today I discovered some really interesting issue with TFS. I was sending it the following message, and no, you are not seeing double, it was doubled. That was the XML payload that I was sending to a web service.

Now, the crazy thing about this, it worked. And that really scares me.

You could argue that SVN's behavior is correct, but there is not way that this can be considered a valid XML document.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Header>
        <RequestHeader 
            xmlns="http://schemas.microsoft.com/TeamFoundation/2005/06/WorkItemTracking/ClientServices/03">
            <Id>uuid</Id>
        </RequestHeader>
    </soap:Header>
    <soap:Body>
        <GetWorkItem 
            xmlns="http://schemas.microsoft.com/TeamFoundation/2005/06/WorkItemTracking/ClientServices/03">
            <workItemId>2192</workItemId>
            <revisionId>0</revisionId>
            <minimumRevisionId>0</minimumRevisionId>
            <asOfDate xsi:nil="true" />
            <useMaster>true</useMaster>
        </GetWorkItem>
    </soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Header>
        <RequestHeader 
            xmlns="http://schemas.microsoft.com/TeamFoundation/2005/06/WorkItemTracking/ClientServices/03">
            <Id>uuid</Id>
        </RequestHeader>
    </soap:Header>
    <soap:Body>
        <GetWorkItem 
            xmlns="http://schemas.microsoft.com/TeamFoundation/2005/06/WorkItemTracking/ClientServices/03">
            <workItemId>2192</workItemId>
            <revisionId>0</revisionId>
            <minimumRevisionId>0</minimumRevisionId>
            <asOfDate xsi:nil="true" />
            <useMaster>true</useMaster>
        </GetWorkItem>
    </soap:Body>
</soap:Envelope>