cancel
Showing results for 
Search instead for 
Did you mean: 

Content is not allowed in Prolog error while configuring File to Mail

Former Member
0 Kudos

Hi Expert,

I have a scenario where I have to pick up a file from FTP using sender File adapter and send this file as an attachment using Receiver Mail adapter.

There are 3 requirements :

1) File name of the attachment in the Mail should be same as the File picked from FTP.

2) The Mail content should be "Please find attached the <Filename> for your reference.

i.e The content has to be dynamic

3) Subject of the Mail should be dynamic e.g : Apple_<Filename>

I am facing the following issues :

1. Since single File is picked up,the file is going as an payload and not as an attachment.As a result when i am doing message mapping,i am getting the error saying "Content is not allowed in prolog" in SXMB_MONI or Runtime workbench.

2. Since we have dynamic requirements, i have to Use "Use Mail Package" option.It implies that i have to use Message Mapping.But if i use Message Mapping,i get the error "Content is not allowed in prolog".

I understand that most of the experts would ask me to write UDF's, but if i use UDF i am getting the "Content is not allowed in prolog" error.

Thanks

Saurabh

Accepted Solutions (1)

Accepted Solutions (1)

former_member463616
Contributor
0 Kudos

Hi,

Please see the below thread, it might be help to you.

[Receiver Mail Adapter|;

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Saurabh,

I am not sure if your original problem got solved or not. The following blog helped me to solve the same issue.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/08/16/the-mystery-of-content-is-not-all...

Regards,

Aman

former_member463616
Contributor
0 Kudos

Hi,

>>When i am using sender File adapter (considering i am picking TXT file), is the TXT file converted to XML?

Yes. It will convert text file to xml file, if you are using Sender File Content Conversion(Sender side).

If everything goes fine, then you can visible xml file in payload by using the T.code SXMB_MONI.

Hope this helps.

Regards,

P.Rajesh

Former Member
0 Kudos

Hi Saurabh

Try using PayloadSwapBean:

http://help.sap.com/saphelp_nw70/helpdata/en/6b/4493404f673028e10000000a1550b0/content.htm

http://help.sap.com/saphelp_nw70/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/content.htm

"Content is not allowed in prolog" could be caused by some encoding issue.

Regards,

Giuseppe

Former Member
0 Kudos

Hi Giuseppe,

Thanks for your prompt reply.

Since i have only one payload, i cannot use the PayloadSwapBean.

From what i understand, since i am using the File adapter, the file is picked up as the payload and not as an attachment.

Now while doing Message Mapping,how should i pass this payload (which is actually the content of the file that is picked up) to the Content field of the Mail adapter.

Thanks

Saurabh

former_member200962
Active Contributor
0 Kudos
Now while doing Message Mapping,how should i pass this payload (which is actually the content of the file that is 
picked up) to the Content field of the Mail adapter.

You surely cannot do this with the normal Message Mapping.

Search SDN for " XML to String" ....you can find XSLT/ JAVA mappings using which you can pass the input payload to the Content Field.

Former Member
0 Kudos

Thanks a ton Abhishek and Rajesh,

I have one doubt..When i am using sender File adapter (considering i am picking TXT file), is the TXT file converted to XML?

Former Member
0 Kudos

If you have a flat text file and you want to convert it to XML you need to define content conversion on sender file adapter.

How to set content conversion in sender file adapter is explained here:

http://help.sap.com/saphelp_nw70/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

Regards,

Giuseppe