cancel
Showing results for 
Search instead for 
Did you mean: 

Adapter and Integration engines: what Unicode?

nicola_martella2
Participant
0 Kudos

Hi people.

I have a question about unicode character problem.

A communication channel file sender processes a text file containing a 0x1a character that in UTF-8 is coded 001A.

The Adapter Engine (Java) correctly processes the file and in communication channel monitor I have the XML message with a rectangle character in the middle of description.

When the message is passed to the Integration Engine the message fails with the following error:

<SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>

<SAP:P1>com/sap/xi/tf/_mm_rdc_to_jdbc_</SAP:P1>

<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException:</SAP:P2>

<SAP:P3>An invalid XML character (Unicode: 0x1a) was found</SAP:P3>

<SAP:P4>in the element content of the document.</SAP:P4>

<SAP:AdditionalText />

<SAP:Stack>Runtime exception occurred during application mapping com/sap/xi/tf/_mm_rdc_to_jdbc_; com.sap.aii.utilxi.misc.api.BaseRuntimeException:An invalid XML character (Unicode: 0x1a) was found in the element content of the document.</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

Why are two engines operate in a different way the same message?

Thanks for your attention.

Ciao

Nicola

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

You are right, that there are different level of error tolerance.

0x1a is a control character which is not allowed inside an XML document.

The mapping tool tries to parse the XML document and finds this invalid.

The file adapter does not parse the document, so without using  mapping you can send any binary through PI.

nicola_martella2
Participant
0 Kudos

Stefan, thank you for your contribution.

You say that the file adapter doesn't parse the document. Indeed, the file adapter provides the inbound for a mapping but the field containing the 0x1a is not mapped.

In your opinion, could be this the reason why the adapter is not failed and the character is visible in the text value like a rectangle?

If the answer is yes, this would mean that the integration engine, instead, parses ever the xml received from the adapter and then fails.

Thanks and ciao

Nicola

stefan_grube
Active Contributor
0 Kudos

Not the integration engine, but the mapping parses the document and fails.

The issue is the original text document which includes a control character.

The sender of the document must not put any 1A characters into it.

nicola_martella2
Participant
0 Kudos

Stefan,

then, if I right understood, the problem is not the XML Runtime (Java or ABAP) but the mapping parser that, when finds a control character, fails the mapping.

Ok, thank you very much for clarified this question.

Ciao

Nicola

Answers (2)

Answers (2)

prateek
Active Contributor
0 Kudos

Well, even though you see error in sxmb_moni, the message mapping itself is java based. It is the encoding mechanism of java based message mapping (not java mapping) which is throwing the error.

Regards,

Prateek Raj Srivastava

zameerf
Contributor
0 Kudos

Hi Nicola,

Did you try setting the below parameters in your File Sender Adapter?

Source Tab Page->Transfer Mode->Text

Processing Tab Page->File Type->Text and File Encoding->UTF-8

By default the file would be transferred in Binary mode.