Author Topic: Error while decoding the response from the Webservice  (Read 4543 times)

0 Members and 1 Guest are viewing this topic.

norman

  • Administrator
  • Sr. Member
  • *****
  • Posts: 268
    • View Profile
    • Zipzap Computers Limited
Error while decoding the response from the Webservice
« on: June 22, 2018, 03:44:56 pm »
This simply means that the data coming from TPN cannot be deciphered. It can be due to two reasons -

1. TPN are restricting the download size from the server. Try to download again but choosing consignments only.

2. The data includes invalid characters which should not be present in the data.

It seems that the TPN Web Services currently do not handle multiple lines in Special Instructions nor do they deal with some non standard characters either.

They cause a malformed returned XML wrapper which cannot be decoded properly. So TPN SOAP will return an error as it cannot get a valid reply. It will also be wrong in other programs such as SOAPUI.

You will see something like this :-

Error at line 140 of Local Procedure GetAllRecords process.

Error while decoding the response from the Webservice:

The XML document has not been loaded.

System Error Details:

Row 4, Column 187536: xmlParseCharRef: invalid xmlChar value 2
Row 4, Column 190094: xmlParseCharRef: invalid xmlChar value 2
Row 4, Column 192655: xmlParseCharRef: invalid xmlChar value 2
Row 4, Column 195213: xmlParseCharRef: invalid xmlChar value 2


or another example :-

Error at line 140 of Local Procedure GetAllRecords process.

Error while decoding the response from the Webservice:

The XML document has not been loaded.

System Error Details:

Row 1, Column 324161: xmlParseCharRef: invalid xmlChar value 7
Row 1, Column 324183: xmlParseCharRef: invalid xmlChar value 7


Valid characters are normally from 32 to 126. In the text above we see 2 on the top example and 7 on the bottom.

In TPN Connect simply DO NOT enter text and press the Carriage Return key on the Special Instructions field or use non standard characters in other fields.

TPN are going to correct this but no date is scheduled.

Fixing requires finding the invalid characters and replacing them with valid ones.

The solution is to run SOAPGUI on the TPN Web Services procedure of GetConsignments. The response will be a single line of text rather than the formatted XML reply. Cut and paste this into Notepad and look for the indicated xmlChar which will be embedded in a short string starting with &#x. You will be able to see the consignment number and the field involved. Go to this record in TPN Connect and alter the text to remove the characters. This will resolve the issue.

Norman
 ;)

« Last Edit: November 11, 2021, 08:44:43 am by norman »