亚马逊MWS ContentMD5DoesNotMatch

<?php
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope>
    <Header>
        <DocumentVersion>1.01</DocumentVersion>
        <MerchantIdentifier>**SELLER ID**</MerchantIdentifier>
    </Header>
    <MessageType>Price</MessageType>
    <Message>
        <MessageID>1</MessageID>
        <Price>
            <SKU>2500le</SKU>
            <StandardPrice currency="GBP">110.58</StandardPrice>
        </Price>
    </Message>
</AmazonEnvelope>';

echo "<strong>Just MD5 </strong>".md5($xml)."</br>";
echo "<strong>Just MD5 BE64 </strong>".base64_encode(($xml))."</br>";
echo "<strong>Trimmed MD5 </strong>".md5(trim($xml))."</br>";
echo "<strong>Trimmed MD5 BE64 </strong>".base64_encode(md5(trim($xml)))."</br>";
echo "<strong>Just MD5 True </strong>".md5($xml, true)."</br>";
echo "<strong>Just MD5 True BE64 </strong>".base64_encode(md5($xml, true))."</br>";
echo "<strong>Just MD5 True Trimmed </strong>".md5(trim($xml), true)."</br>";
echo "<strong>Just MD5 True Trimmed BE64 </strong>".base64_encode(md5(trim($xml), true))."</br>";
?>

I'm trying to get my content MD5 to match with the content MD5 on amazons scratchpad.

The MD5 on the scratchpad for the exact same piece of XML is : 514f53797911925b337c4461c30ca003 and base 64 MD5 is : UU9TeXkRklszfERhwwygAw==

I can't seem to match this at all.

Firstly can anyone see where i'm going wrong, does anyone have some working code to do a CURL post to do a submitfeed to amazon MWS with a feedtype of _POST_PRODUCT_PRICING_DATA_ ?

I've tried everything..

Don't know if you're still looking for an answer on this.

However, here's my answer; When you MD5 encode your xml, you have to return the raw value of the MD5 using the second parameter;

example:

$var = md5($xml,true)