cancel
Showing results for 
Search instead for 
Did you mean: 

How to send the entire binary file as Content in mail adapter

Former Member
0 Kudos

Hi,

I have the below scenario:

A binary file is there on the XI server and this is more than 1 lines.

This file needs to be sent across to certain email addresses via the XI interface.

I have made the design and config and now get the the mail but so far not been able to get the file contents.

The requiremnet is to send the entire file contents in the mail so that they appear in the body of the received mail.

How do i do it?

Can you please advice.

Regards,

Archana

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi!

Use a Sender File Adapter and hand it over (if you want with mapping) to the mail adapter.

By the way: Are you really sure that you want to send binary file content as mail body? Who will be able to "read" it?

Regards,

Volker

Former Member
0 Kudos

Hi,

The binary file is more like the control file from the bank for which the busines has the look up for the codes received giving the status of the file. Then there is the payment file and the rejection file which is actually in EN but without extension. I tried sending the file as attachemnt but it is not going through plus the file should not be in .xml.

How do i do that instead?

Can you please suggest how to acgive the attachment solution?

Regards,

Archana

Former Member
0 Kudos

Hi!

Refer to here: http://help.sap.com/saphelp_nwpi71/helpdata/en/43/96cb0fb9335b77e10000000a11466f/frameset.htm

Hope this will solve your issue.

Regards,

Volker

Former Member
0 Kudos

Hi,

I have made the DT with base64binary type, message type for it and message interface. I have then made the mapping for incoming message into Mail type. In configuration, I have a sender file adapter to pick up the file and receiver mail adapter with check for Use Mail Package and using XIpayload. However, if I do not use the FCC, the incoming file as it is something like below:

UNBUNOA:3HEXAGON-ABCABC10268002081201:2152+692125127893 and so on, is not understood and I get that the XML could not be understood in the payload as:

Invalid at the top level of the document. Error processing resource 'http://dts1dv:50200/mdt/messagecontentservlet?attachme...

Please tell me how to proceed from here as I am stumped.

As the incoming file is not understood, the receiver mail adapter does not receive the message to be sent out as mail.

Regards,

Arcahna

former_member200962
Active Contributor
0 Kudos
However, if I do not use the FCC, the incoming file as it is something like below:

'

dont think you can proceed without using FCC / adapter module here....the Binary file needs to be stuffed in the node of your Source XML message format.....so you have to proceed accordingly.

Former Member
0 Kudos

hi,

I have made some more test but the resulyt is not OK.

The incoming file has structure (due to FCC) - recordset -

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

<ns:MT_Ack_Mail_In xmlns:ns="Urn:Serco-com:interface:Banking:HSBC:FileTransfer">

<Content> <Mail><Details>UNBUNOA:3HEXAGON-ABCABC10268002081201:2152+692125127893</Details></Mail>

and many more instances of mail-Details.

The mail message has only 1 Content field -

How do I map all the instances to 1 content - it only takes the first occurrence -

I even tried XSL mapping but what do I do to get the complete message with many lines across in Content?

If this is not feasible, then how can I transfer the whole ocntents as attachment (in .TXT format) in email?

Please help.

Regards,

Archana

Former Member
0 Kudos

Hi,

I am giving below the incoming mesasge details and the outgoing Mail message details.

Sender File Adapter:

Mesasge Content/Payload:

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

- <ns:MT_Ack_Mail_In xmlns:ns="Urn:Serco-com:interface:Banking:HSBC:FileTransfer">

- <Content>

- <Mail>

<Details>UNBUNOA:3HEXAGON-ABCABC10268002081201:2152+692125127893</Details>

</Mail>

- <Mail>

<Details>UNH1CONTRL:2:2:UN:APACS</Details>

</Mail>

- <Mail>

<Details>UCI1000246720ABC10268002HEXAGON-ABC4+C09</Details>

</Mail>

- <Mail>

<Details>UNT31</Details>

</Mail>

- <Mail>

<Details>UNZ1692125127893</Details>

</Mail>

</Content>

</ns:MT_Ack_Mail_In>

Receiver Mail Adapter:

Message Content/Payload:

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

- <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">

<Subject>ME-Acknowledgement</Subject>

<From>email of from</From>

<To>my email</To>

</ns1:Mail>

I need to map the contents of the incoming payload Contents/Mail/Details (all the 5 instance) to outgoing Missing Content (after To field).

If it can be in Mail body, then it would be best else please suggest what other option can I use?

Also, If i want the file name to be in the subject of the mail, is that possible to be picked up in the configuration?

Please help.

Regards,

Archana

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos

Hi,

On the File Sender side:

1) Create a DT with a field having xsd type as base64Binary (havent checked but may be string will also do).....then put your Binary file-content into this node....

On the Mail Receiver side:

1) Import the Mail xsd into IR

2) Create a message mapping and map the Binary node to the Content node of the mail xsd...since you wont need to format the mail body you can use Message Mapping...

In the Receiver channel use Messag Protocol: XIPAYLOAD; Check "Use Mail Package"

One small point to mention:

If there is a problem in passing the Binary file-content using the Message Mapping then take the help of CDATA element (i.e. use a XSL mapping) and map the content to the target Content node.

Regards,

Abhishek.

Edited by: abhishek salvi on Jun 15, 2009 2:23 PM