cancel
Showing results for 
Search instead for 
Did you mean: 

File Receiver Adapter - writes empty message

Former Member
0 Kudos

Hi All,

I have an file FTP receiver channel configured with content conversion. I also have set the "Empty-Message-Handling"  to "Ignore".

My problem is now:I've get this error to my CC :

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error occurred while connecting to the FTP server "xxxxxxxxxxxxxx": 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)'

I've checking the payload and there is no record set (no data)

"Aucune information de style ne semble associée à ce fichier XML. L'arbre du document est affiché ci-dessous."

      <ns0:MT_XXXXXXXXX/>

Does anyone have an idea why empty message are not getting ignored by this setting?

Thanks in advance for your help,

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks for your answer, talking with my supervisor so Java mapping is not allowed for our project so I have to choice MessageTransformBean.

Is there someone here who has already work on it plz?

your help will be appreciated

sahithi_moparthi
Contributor
0 Kudos

I think the Problem is with your FCC .

Former Member
0 Kudos

I Sahiti,

could you please give more explanation ?

Thx in advance

sahithi_moparthi
Contributor
0 Kudos

Hi,

Even i faced the same error Many times when i configured with FCC like :

Error occurred while connecting to the FTP server "xxxxxxxxxxxxxx": 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)'

      Please chk each and every field in the FCC whether you have Mentioned it in the right way as per the structure.you can also test by Placing the Segment one by one.So that it will become to trace.Tracing the Error in FCC is a bit difficult.Please let us know in detail  about the Structure you have and also the FCC that u have Mentioned.

    Please correct if my understanding was wrong.

                  Thanks in Advance

Former Member
0 Kudos

Hi Sahithi,

I've only got this error when I've get this payload :

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_XXXXXXXXXXXXXX xmlns:ns0="http://abced/ab"></ns0:MT_XXXXXXXXXXXXXX>

Thanks for your help.

sahithi_moparthi
Contributor
0 Kudos

Try by removing the XML NameSpace in Message Type.

Former Member
0 Kudos

How can it be done? give me a clue plz

sahithi_moparthi
Contributor
0 Kudos

can you Please give us the details abt the Sender channel and the in Receiver Channel what you are using in the Recordset structure.

Please chk this Link this may help you

http://scn.sap.com/people/karthiknarayan.kesavan2/blog/2007/08/22/file-content-conversion-for-multi-...

Former Member
0 Kudos

Hi Sahithi,

My scenario is IDOC to FILE, you can find the description of the issue here :http://scn.sap.com/message/13200200#13200200

Thx

Former Member
0 Kudos

Thanks for your answer, as I said I've never working in Java mapping so can somebody tell me how and where I can implement it in my mapping ?

Former Member
0 Kudos

Please have a look on this blog I just created after looking through this thread - it has working code for Java mapping you need.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/04/17/file-receiver-adapter-better-util...

Former Member
0 Kudos

might be  the problem with your message structure / related to the heirarchy of the nodes.

have  u seen below blogs:

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

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

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

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

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Ignore Empty Message only works if there is no root message as was described in SAP Note 0000821267 - FAQ File Adapter

Q: I configure the receiver channel with File content conversion mode and I set the 'Empty Message Handling' option to ignore. Input payload to the receiver channel is generated out of mapping and it does not have any record sets. However, this payload has a root element. Why does file receiver create empty output file with zero byte size in the target directory? Example of such a payload generated from mapping is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<ns1:test xmlns:ns1="http://abcd.com/ab"></ns1:test>

 

A: If the message payload is empty (i.e., zero bytes in size), then File adapter's empty message handling feature does NOT write files into the target directory. On the other hand, if the payload is a valid XML document (as shown in example) that is generated from mapping with just a root element in it, the File Adapter does not treat it as an empty message and accordingly it writes to the target directory. To achieve your objective of not writing files (that have just a single root

element) into the target directory, following could be done:

- Either modify your mapping so that empty message payload without a root element is generated. This could be done only by creating a Java mapping and implement the logic to convert from root element to an empty text. This can not be done using Message Mapping tool.

- or, use a module based approach, e.g., using the

StrictXml2PlainBean, where such a valid XML payload is converted to an empty payload before the file receiver channel is invoked.

I used Java Mapping to solve ours.

Hope this helps,

Mark

Former Member
0 Kudos

Thank you very much for your answer, the payload generated from the mapping is like  :

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:MT_XXXXXXXXXXXXX xmlns:ns0="http://abcd.xx/ab" />

For info, I use graphical mapping and I've never working with java mapping. So what  should I do then?

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

The output of your Operation Mapping should be from

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:MT_XXXXXXXXXXXXX xmlns:ns0="http://abcd.xx/ab" />

To

which means the root message should be completely gone for the File Receiver Adapter not to create the empty message hence it was suggested to use Java Mapping or MessageTransformBean. What you can do in your Java Mapping is to check the length of the message when it does not contain any recordsets and output an empty string.

I have not tried using the MessageTransformBean though.

Hope this helps,

Mark