在 RoR 应用程序上,我正在处理哪个书承运人发货,当我尝试使用 TNT API 发送标签请求进行预订时,我收到以下错误:
Exception: BookingLib::Errors::AwbDocumentFailedException
Error code: awb_xml_failure
Error data:
9200
Issue with validating TNT common systems data
我不知道为什么这样,也不知道这意味着什么。
我的XML:
<?xml version="1.0" encoding="UTF-8"?>
<labelRequest>
<consignment key="CON1">
<consignmentIdentity>
<consignmentNumber>123456782</consignmentNumber>
<customerReference>Robert's computer</customerReference>
</consignmentIdentity>
<collectionDateTime>2008-06-12T13:00:00</collectionDateTime>
<sender>
<name><%= transform_to_tnt_char_set(tnt_sender.company_name) %></name>
<addressLine1><%= transform_to_tnt_char_set(tnt_sender.address_line1) %></addressLine1>
<addressLine2><%= transform_to_tnt_char_set(tnt_sender.address_line2) %></addressLine2>
<addressLine3><%= transform_to_tnt_char_set(tnt_sender.address_line3) %></addressLine3>
<town><%= transform_to_tnt_char_set(tnt_sender.city) %></town>
<exactMatch>Y</exactMatch>
<province>Warks</province>
<postcode><%= transform_to_tnt_char_set(tnt_sender.zip_code) %></postcode>
<country><%= transform_to_tnt_char_set(tnt_sender.country_code) %></country>
</sender>
<delivery>
<name><%= transform_to_tnt_char_set(tnt_recipient.company_name) %></name>
<addressLine1><%= transform_to_tnt_char_set(tnt_recipient.address_line1) %></addressLine1>
<addressLine2><%= transform_to_tnt_char_set(tnt_recipient.address_line2) %></addressLine2>
<town><%= transform_to_tnt_char_set(tnt_recipient.city) %></town>
<exactMatch>Y</exactMatch>
<province/>
<postcode><%= transform_to_tnt_char_set(tnt_recipient.zip_code) %></postcode>
<country><%= transform_to_tnt_char_set(tnt_recipient.country_code) %></country>
</delivery>
<product>
<lineOfBusiness>2</lineOfBusiness>
<groupId>0</groupId>
<subGroupId>0</subGroupId>
<id>EX</id>
<type>N</type>
<option>PR</option>
</product>
<account>
<accountNumber>100445</accountNumber>
<accountCountry>GB</accountCountry>
</account>
<totalNumberOfPieces>3</totalNumberOfPieces>
<pieceLine>
<identifier>1</identifier>
<goodsDescription>piecelinegoods desc</goodsDescription>
<pieceMeasurements>
<length>1.11</length>
<width>1.11</width>
<height>1.11</height>
<weight>1.11</weight>
</pieceMeasurements>
<pieces>
<sequenceNumbers>1,2</sequenceNumbers>
<pieceReference>keyboard and mouse</pieceReference>
</pieces>
<pieces>
<sequenceNumbers>3</sequenceNumbers>
<pieceReference>computer tower</pieceReference>
</pieces>
</pieceLine>
</consignment>
</labelRequest>
预订调用 API 以取回带有 XML 参数的标签,并且应显示已准备好打印。但是,相反,我得到了我无法理解的错误9200。
如果需要更多代码,我愿意请求编辑我的问题。
Rendered XML
<?xml version="1.0" encoding="UTF-8"?>n
<labelRequest>n
<consignment key="CON1">n
<consignmentIdentity>n
<consignmentNumber>123456782</consignmentNumber>n
<customerReference>Robert's computer</customerReference>n
</consignmentIdentity>n
<collectionDateTime>2008-06-12T13:00:00</collectionDateTime>n
<sender>n
<name>HeyHO</name>n
<addressLine1>Sollerodgade 25,3</addressLine1>n
<addressLine2></addressLine2>n
<addressLine3></addressLine3>n
<town>Kobenhavn N</town>n
<exactMatch>Y</exactMatch>n
<province>Warks</province>n
<postcode>2200</postcode>n
<country>dk</country>n
</sender>n
<delivery>n
<name>Customer B</name>n
<addressLine1>Sollerodgade 25,3</addressLine1>n
<addressLine2></addressLine2>n
<town>Kobenhavn N</town>n
<exactMatch>Y</exactMatch>n
<province/>n
<postcode>2200</postcode>n
<country>dk</country>n
</delivery>n
<product>n
<lineOfBusiness>2</lineOfBusiness>n
<groupId>0</groupId>n
<subGroupId>0</subGroupId>n
<id>EX</id>n
<type>N</type>n
<option>PR</option>n
</product>n
<account>n
<accountNumber>100445</accountNumber>n
<accountCountry>GB</accountCountry>n
</account>n
<totalNumberOfPieces>3</totalNumberOfPieces>n
<pieceLine>n
<identifier>1</identifier>n
<goodsDescription>piecelinegoods desc</goodsDescription>n
<pieceMeasurements>n
<length>1.11</length>n
<width>1.11</width>n
<height>1.11</height>n
<weight>1.11</weight>n
</pieceMeasurements>n
<pieces>n
<sequenceNumbers>1,2</sequenceNumbers>n
<pieceReference>keyboard and mouse</pieceReference>n
</pieces>n
<pieces>n
<sequenceNumbers>3</sequenceNumbers>n
<pieceReference>computer tower</pieceReference>n
</pieces>n
</pieceLine>n
</consignment>n
</labelRequest>"
(byebug) label_request_xml
"
<?xml version="1.0" encoding="UTF-8"?>n
<labelRequest>n
<consignment key="CON1">n
<consignmentIdentity>n
<consignmentNumber>123456782</consignmentNumber>n
<customerReference>Robert's computer</customerReference>n
</consignmentIdentity>n
<collectionDateTime>2008-06-12T13:00:00</collectionDateTime>n
<sender>n
<name>HeyHO</name>n
<addressLine1>Sollerodgade 25,3</addressLine1>n
<addressLine2></addressLine2>n
<addressLine3></addressLine3>n
<town>Kobenhavn N</town>n
<exactMatch>Y</exactMatch>n
<province>Warks</province>n
<postcode>2200</postcode>n
<country>dk</country>n
</sender>n
<delivery>n
<name>Customer B</name>n
<addressLine1>Sollerodgade 25,3</addressLine1>n
<addressLine2></addressLine2>n
<town>Kobenhavn N</town>n
<exactMatch>Y</exactMatch>n
<province/>n
<postcode>2200</postcode>n
<country>dk</country>n
</delivery>n
<product>n
<lineOfBusiness>2</lineOfBusiness>n
<groupId>0</groupId>n
<subGroupId>0</subGroupId>n
<id>EX</id>n
<type>N</type>n
<option>PR</option>n
</product>n
<account>n
<accountNumber>100445</accountNumber>n
<accountCountry>GB</accountCountry>n
</account>n
<totalNumberOfPieces>3</totalNumberOfPieces>n
<pieceLine>n
<identifier>1</identifier>n
<goodsDescription>piecelinegoods desc</goodsDescription>n
<pieceMeasurements>n
<length>1.11</length>n
<width>1.11</width>n
<height>1.11</height>n
<weight>1.11</weight>n
</pieceMeasurements>n
<pieces>n
<sequenceNumbers>1,2</sequenceNumbers>n
<pieceReference>keyboard and mouse</pieceReference>n
</pieces>n
<pieces>n
<sequenceNumbers>3</sequenceNumbers>n
<pieceReference>computer tower</pieceReference>n
</pieces>n
</pieceLine>n
</consignment>n
</labelRequest>
您需要将业务行号(行从 <lineOfBusiness>2</lineOfBusiness>
更改为 <lineOfBusiness>1</lineOfBusiness>
对于国内 dk 到 dk 的传输,应为"1"。2 适用于国际非国内转账...