Loading

Data Encoding Error 'Invalid UTF-8 middle byte' After Reading File From FTP Directory With MuleSoft SOAP Connector

Data pubblicazione: Jan 9, 2026
Descrizione

You have a Flow that reads a file from an FTP directory. When you map it into another structure to be delivered using the MuleSoft SOAP connector, an error like below is thrown:

"\"org.mule.weave.v2.module.reader.ReaderParsingException: Invalid UTF-8 middle byte 0x20 (at char #317, byte #127)\nTrace:\n at main (Unknown), while reading `payload` as Xml.\nTrace:\n at main (Unknown)\n\" evaluating expression: \"%dw 2.0\noutput application/json skipNullOn = \"everywhere\"\nns ns0 [......] "."
Risoluzione

The cause of the MuleSoft Flow error "Invalid UTF-8 middle byte", is that the mapping cannot parse the input message due to some unexpected characters being received in the file being read from the FTP directory.

SOLUTION

In the File Read Flow, set the MIME Type to application/xml and Encoding parameter to ISO-8859-1  as shown in the screenshot example below:
screenshot

Numero articolo Knowledge

001121702

 
Caricamento
Salesforce Help | Article