Why do I receive the error message: “Invalid message: Invalid XML message, invalid xml declaration” ?

Tradeplace XML should contain some mandatory lines, this is the more frequent reason for this error.

Each TradeXML you will send needs to start with the following 3 lines : 

  1. <?xml version="1.0" encoding="UTF-8"?>
    This line is needed for the encoding type, always specify UTF-8 here.
  2. <!DOCTYPE TradeplaceMessage SYSTEM "http://xml.tradeplace.com/schemas/TradeXML/2.0.0/TradeXML.dtd">
    This line will help determining which version of the protocol you are using. Here this is version 2.
  3. <TradeplaceMessage xmlns="http://xml.tradeplace.com/schemas/TradeXML/1.0.0/TradeXML.dtd" productionMode="test">
    This third line is also mandatory and should remains as such except for the productionMode attribute which can be : test or production

If you have the same lines, then now the error should disapear.