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

Empty file creation in PI 7.3

Hello, I've implemented a proxy-to-file scenario in PI 7.3 dual-stack installation. I've used content conversion in the receiver adapter as follows:

Message Structure:

<ns0:MT_Data_In xmlns:ns0="http://project.client.com">

<DetailRec>

<Field1>val1</Field1>

<FieldN>valN</FieldN>

</DetailRec>

<DetailRec>

......

</DetailRec>

<TrailerRec>

<FieldA>valA</FieldA>

</TrailerRec>

</ns0:MT_Data_In>

Content Conversion Parameter in the Receiver Channel

Recordset Structure: DetailRec,TrailerRec

DetailRec.fieldFixedLengths

DetailRec.endSeparator

TrailerRec.fieldFixedLengths

TrailerRec.endSeparator

It works well when there are detail and trail records in the message.

When there are no Detail Records, there will not be any trailer records either. This is done in message mapping.

The Message would like this:

<ns0:MT_Data_In xmlns:ns0="http://project.client.com"></ns0:MT_Data_In>

In such a case, I'm supposed to write an empty output file (size 0). I've set the "Empty-message handling" to "Write Empty File" in the file receiver channel. Yet, I'm seeing the following error in the channel monitor:

Could not process due to error: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure '' found in document', probably configuration error in file adapter (XML parser error)'

Any help in resolving this issue is greatly appreciated! Thank you very much!!

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Dec 11, 2012 at 06:16 AM

    Hello,

    >>The Message would like this:

    >><ns0:MT_Data_In xmlns:ns0="http://project.client.com"></ns0:MT_Data_In>

    Ur message is exactly not empty so what u can do is create one java mapping which will check if the detailsRec nodes are present or not and if in case it's not there then create empty (blank) output in the mapping....and then i think empty message handling will work and u can create empty file on ftp/NFS server

    refer this thread:

    http://scn.sap.com/thread/3164581

    Thanks

    Amit Srivastava

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 11, 2012 at 05:53 PM

    Hi,

    This error message is always caused by the invalid XML content in the beginning element. For example, extra small dot “.” in the beginning of XML element.

    Any characters before the “<?xml….” will cause above “org.xml.sax.SAXParseException: Content is not allowed in prolog” error message.

    Please go to SXMB_MONI and open the Inbound Payload. There you should see any extra unwanted character.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      This means when Java Mapping is expecting a xml data with proper xml notations, its only getting "NUL" as you mentioned you can see with Textpad/notepad. Mapping is failing because Parser (SAX is a XML parser) is thinking that "NUL" is there before “<?xml….”, but actually nothing is present. You need to discuss with the Sender System persons to why they are sending this.

      In IE also, its showing this because not able to process XML data.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2012 at 06:03 PM

    I just found that in this installation of PI 7.3, the content conversion is failing when there is more than one recordset structures - DetailRec and TrailerRec in this case. If there is only one recordset structure, then the content conversion works and creates a empty file if there is no data. I couldn't find a note to resolve this issue. So, I've worked around it to send the message to 2 different interfaces - one with a channel with FCC to process message with recordsets and other with a channel with FCC (that uses only one recordset) to process message with no recordset.

    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.