cancel
Showing results for 
Search instead for 
Did you mean: 

Content not allowed in prolog problem

Former Member
0 Kudos

Hello!

I have still some Problems with my simple Scenario. It uses a file Sender Adapter to read a .pdf file from disk, and sends it to an email address by mail Receiver Adapter! To achieve that the attachment in the mail has the same Name as the file read by the file Sender, i created a UDF with some Java coding. Now, there is a problem: There is some error message that says "Content is not allowed in Prolog" and I dont't know what is meant by this?

BR, EF

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member208856
Active Contributor
0 Kudos

check the below message thread for .PDF file Scenario :

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

Former Member
0 Kudos

Hi!

I don't want to convert the .pdf to XML or something, i just want to send it directly to the mail Receiver, but with the correct filename!

BR, EF

iaki_vila
Active Contributor
0 Kudos

Hi Elmar,

Shabarish Vijayakumar explains this error in his blog . Try to follow its advice.


Regards,

Former Member
0 Kudos

Hi!

Thanks; i already tried to remove all SWCV entries, but the error persists ... but i have another question. Is it anyway possible to read the filename from a file Sender Adapter? I think this should be possible, because for this purpose it has been built!?

BR, EF

former_member208856
Active Contributor
0 Kudos

Are you using any Message Mapping ?

Sender is .Pdf file, the error shows that System is not able to parse the file data in XML.

Former Member
0 Kudos

Hello!

The only mapping that takes place is a dummy mapping, only to get the process running ... what i want is simple, i want to read a pdf file by file Sender and send it to a mail Receiver ... i do not Need any mapping if you mean that! I created it just for the purpose of starting the process ...

former_member184720
Active Contributor
0 Kudos

As already mentioned by Sandeed, i believe it's bacuase you are trying to process PDF file.

GO for the java mapping and set the attachment name in it.

Refer to below thread for the java code

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

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/01/04/dynamic-filename-in-mail-receiver...

Former Member
0 Kudos

Hi!

Just for my own curiosity, ... is there absolutely no field, which could be read from the Sender File Adapter? I cannot believe, that i extra have to write a complete Java Mapping, just to get the filename which has definitely been provided to the Adapter when it read the file from disk ...?

BR, EF

azharshaikh
Active Contributor
0 Kudos

Hi,

I believe there is no direct mechanism as such. You need Java / Cust Module /UDF to achieve this.

Have you checked the following link. You can add the given code in your Dummy MM under UDF (instead of creating a Java Mapping) and try if it helps...

Regards,

Azhar

Former Member
0 Kudos

Hi!

I will check your solution, but what I ask myself is, why does this solution http://scn.sap.com/community/pi-and-soa-middleware/blog/2005/11/10/xi-the-same-filename-from-a-sende... not work for me? What I get here, is a Content not allowed in Prolog error .. AND i have used my Integrated Configuration without SWCVs ...

BR, EF

iaki_vila
Active Contributor
0 Kudos

Hi Elmar,

According with Shabarish suggestion conf.get() method works only in runtime period. Have you tried to use conf.put(key, myFileName); instruction?. Check Shabarish blog: http://scn.sap.com/community/pi-and-soa-middleware/blog/2009/03/26/dynamic-configuration-vs-variable...

Regards.

engswee
Active Contributor
0 Kudos

Hi Elmar

Just adding my two cents here.

The blog you referred to is describing a File sender adapter to File receiver adapter scenario. Your scenario on the other hand uses a Mail receiver adapter. Each adapter behaves differently and has different functionality that you cannot expect an apple-to-apple comparison.

For your case, the "Content not allowed in Prolog" is actually caused by two issues. Both are due to parsing of non-XML content.

If you look carefully, the first time you encountered the error, it is caused by a RoutingException (in screenshot above.) This is because of the original SWCV setting in your ICO will not work on a non-XML file, a binary PDF for your case. Removing the SWCV from your ICO only resolved the RoutingException.

Once the first error is resolved, you hit a mapping Runtime Exception which you listed in the blog below.

XI: The same filename from a sender to a receiver file adapter - SP14

As already mentioned by others, this second error is caused by executing a graphical message mapping on a non-XML content. Graphical message mapping can only handle XML content, therefore you cannot even have a simple 1-1 mapping with UDF and expect it to work. Your source binary content does not (and will never) match at all source Data type. This needs to be handled as a Java mapping - whether you create it in an external Java IDE or use this trick to embed it directly in ESR.

Rgds

Eng Swee

Former Member
0 Kudos

Hello!

These 2 Cents, really have their value Thank you! This Explanation was exactly, what i was looking for ... it is hard to follow different approaches when even the Problem is not clearly defined!

I will try to get the Java Mapping running, hopefully ...

Thanks and BR, EF

iaki_vila
Active Contributor
0 Kudos

Hi,

A really good explanation Eng. Elmar, keep us updated if with the java mapping you can solve your problem.

Good luck.

Regards.

Former Member
0 Kudos

Hello!

Here my experience during the last several hours ...

I built an ICO and only defined a File Sender CC and a Mail Receiver CC. I created NO mapping and only 2 Dummy Service Interfaces. Just to make the process work! When I tested it, i got a mail with the wrong Name, this is OK. When i added a Message Mapping, and following an Operation Mapping, then the "Content not allowed in Prolog" error came up! When i did no graphical mapping between the two dummy SIs, then i got a mail with a 209Byte attachment in XML. So, again I tried to map one single field ... this time, the "Content not allowed" error was here again. I have NO SWCVs defined in my ICO, so this cannot be the reason ... What else could be wrong? There is no UDF at the Moment or anything else, just an empty mapping object, what I will Need in the future to Change the filename ...

BR, EF

engswee
Active Contributor
0 Kudos

Hi Elmar

As have been mentioned, as long as you use Message Mapping (or you can call it Graphical Mapping) this error with occur - it does not matter whether it has a UDF or not.

Because you are dealing with binary file, you need Java mapping. Are you familiar with creating Java mappings? You need to create this by writing Java codes in an external IDE - Eclipse or NWDS, and then compile it into a JAR archive file and import it into ESR as an imported archive. Use the imported archive in your Operation mapping (instead of message mapping.)

I suggest that you search in SCN for some guide on how to create Java mapping - there are plenty of wiki and blogs around this topic.

Rgds

Eng Swee

azharshaikh
Active Contributor
0 Kudos

Hi,

Please check & confirm if you have removed the Sender SWCV in ur Config / ICO:

Regards,
Azhar