Skip to Content
author's profile photo Former Member
Former Member

Invalid XML Character (Unicode: 0x0)

Hello guys,

I have a problem with one mapping. The error is that there is an invalid character ( Unicode: 0x0 ). I have seen this is the null character, but how can I found it?

I can't test the message mapping because we have a dynamic configuration function, or there is anyway to test it avoiding the function?

How can I know what is the wrong character? There is any tool that opening the file I can see the character in error.

The scenario is File -> PI -> Proxy

The error is in the message mapping of PI, and file is being taken with Content Conversion, Text Format and UTF-8.

In message mapping the occurence is 0..unbounded so there are no mandatory fields.

Normally this interface is running well but sometimes we have this error.

Many thanks in advance.

Regards,

Xavi.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Dec 13, 2011 at 09:38 AM

    open your file with a hex editor.

    You will find free hex editiors for download with google.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 02:25 PM

    Hello guys,

    one more thing, this interface is using Dynamic Configuration to take the File Name. Always is working, but I can not test the message mapping.

    If I change the message mapping without taking dynamic configuration is working.

    Could this be the problem? Reviewing monitoring the File Name is well-formed and with no strange characters.

    Many thanks,

    Xavi.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Xavi,

      " suppose we have to do it before to take the file, or another way could be to take the file without content conversion, and with a java mapping delete the nulls and create the message we send to R/3.

      What do you think about this?"

      Ans)

      Yes that's correct. You can follow this blog http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4018

      where without FCC the mapping code directly creates the target XML. you can add code to replace all null characters as example shown below

      String line = bin.readLine();
      String s="";
      for(int i=0;i<line.length();++i)
      {
           if(line.charAt(i)!=)0X00)
          {
              s=s+line.charAt(i);
          }
      
      }
      line=s;
      

      Any source interface is fine in interface mapping and no need to use FCC. Rest all setrtings will be normal as per the blog.

      Regards

      Anupam

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 09:33 AM

    Hi,

    Unicode: 0x0 means you get null value for certain element. Please check whether you look for value from the null element during mapping or so? Are you configuring optional elements as mandatory in the file adapter and that cause the error?

    regards,

    ganesh.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Defining Special Characters in Strings for Separators

      You can specify non-printable ASCII characters in all strings for separators (NameA.fieldSeparator, NameA.beginSeparator, and NameA.endSeparator).

      ○ Insert these characters individually in the strings in the form ´0xHH´ (including quotation marks). HH represents the character encoded as a hexadecimal value.

      ○ Add a line break using the character ´nl´ (including the quotation marks); nl stands for new line.

      ○ The special character ´0´ is not a separator character.

      regards,

      ganesh.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 12:20 PM

    Hello guys,

    I thought the error was with characters like 'ç' or 'ñ' and I changed the file encoding to ISO-8859-1 but I have the same error of the invalid character.

    In the original file there are empty lines, but this shouldn't be a problem because the other files are running well.

    The files are from different partners, so we think the error could be in the adapter not in the file.

    Maybe we have to do another configuration in the adapter?

    Many thanks,

    Xavi.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.