on 09-13-2005 6:33 PM
Hi,
we have a problem with the Mail adapter...
We try to send an email out of the XI to some service providers. The outgoing data is stored in an XML structure. This structure agrees with the conventions of the Mail Package format, which is used for dynamic Mail generation. The content of this Mail Package structure is a semicolon separated string, which should be attached as a CSV-File to the outgoing email. Up to this everything works fine. We get the email with the attachement out of the system, send it to a SMTP server and transfer it to a previous defined email address.
But when we open the attachement (with Wordpad, Excel,...) all german umlaut have been lost. The problem is, when transfering the Mail Package content into a File, this File is UTF-8 encoded.
Can anyone give us a hint how to convert the encoding of the attached file from UTF-8 to ISO-8859-1 (Latin-1)?
Actual we have set the following parameters on the module page:
Work sequence
1. localejbs/AF_Modules/MessageTransformBean Local Enterprise Bean XML2Plain
2. localejbs/sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean Local Enterprise Bean mail
Modulconfiguration
XML2Plain Transform.ContentDisposition attachment;filename="ABC.csv"
XML2Plain Transform.ContentType text/plain;charset=latin-1
XML2Plain Transform.ContentDescription "ABC"
I hope we get some help...
Regards,
Lars
Hi,
Hi
We handled the similar requirement in our project.
To convert the target file encoding UTF-8 to ISO-8859-1. For this i have used XSLT mapping, by changing the output encoding as shown in the code.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="urn:abc.com:pi:ab:cd:FileToMail:Mail">
<xsl:variable name="vfileName" select="/a:MT_Mail/FileName"/>
<xsl:output method="text" indent="yes" encoding="iso-8859-1" media-type="TYP"/>
also set the charset value to ISO-8859-1 as shown in the XSLT mapping
<xsl:text>----mime-boundary
Content-Type: text/html; charset="ISO-8859-1"
Content-Disposition: inline
In Adapter module, add XMLAnonymizerBean
Link:http://help.sap.com/saphelp_nwpi71/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm
Hope this will resolve your issue.
Regards,
Divya
Edited by: Divya_10 on Jun 14, 2011 10:20 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you use the mail package, you have to provide the content type information in the tag <i>Content_Type</i>.
So you have to add
<Content_Type>text/plain;charset="ISO-8859-1"</Content_Type>
to the XML.
The entry <i>Transform.ContentType</i> from the module configuration is ignored, when you use the Mail Package.
Hope that helps
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
thank you for your answer... I've changed the XML, but there is no change in the encoding of the attachment. It is still UTF-8.
The Payload from our Message, which you can see in the XI Monitoring (Transaction SXMB_MONI), has the following structure:
<?xml version="1.0" encoding="UTF-8" ?>
<ns0:Mail xmlns:ns0="http://sap.com/xi/XI/Mail/30">
<Subject>Testmessage</Subject>
<From>lars.ottawa@xyz.de</From>
<To>lars.ottawa@xyz.DE</To>
<Content_Type>text/plain;charset="ISO-8859-1"</Content_Type>
<Content>4264673;DE;33334;Bartholomäusweg 26;Gütersloh;Lars;Ottawa;99.9;1;1;;129717</Content>
</ns0:Mail>
When we try to open the attachment (with an editor) we get the following string...
4264673;DE;33334;Bartholomäusweg 26;Gütersloh;Lars;Ottawa;99.9;1;1;;129717
It seems that the Content Type attribute has no effect. Could that be possible?
Regards,
Lars
We are sure that we get a UTF-8 encoded attachment, because when we open it in an UTF-8-compatible Editor and use the UTF-8 view mode, everything looks fine...
The source of this example is a CRM 4.0 system and we are using graphical mappings (message mappings). The semicolon seperated string is created in this mapping with an advanced user defined function.
On our XI service pack 12 is installed.
Lars
Hi Stefan, nice to hear again from you (we have seen us at HUGO..)
the file adapter does the job, only the email adapter fails in encoding the message.
The email adapter should do more jobs for me as i receive messages from outlook/notes
1. Swap to the mysterious content
Content-Type=multipart/alternative
2. Transform it
Transform.ContentType=text/plain; charset=utf-8
3. Swap to attachment
Content-Description=MailAttachment-1
4. Transform .csv-attachment with content conversion
Transform.Class=com.sap.aii.messaging.adapter.Conversion
Transform.ContentType=text/xml;charset=iso-8859-1
xml.conversionType=StructPlain2XML
xml.processFieldNames=...
so the encoding for the transformed message should be iso-8859-1 ?!
I doesnt matter if i use "text/plain" or "text/xml".
If i prepare the email i can skip step 1 and 2 but the result is the same.
You meant "codepage"? Is it another attribute i can set?
btw. interesting effect
if i add the messagetransformationbean to the fileadapter, the umlauts are not changed to utf-8 (auditlog shows the successful transformation to utf-8)?
maybe the "Transform.Class=com.sap.aii.messaging.adapter.Conversion" makes problems?
Next i will try with an already converted csv-to-xml attachment
scenario:
mails with and .csv attachment should be mapped to an rfc-call
i did:
1. sender mail adapter which should convert the attachment using the contentconversion module (from you : https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12...
So i tried to attach the already converted csv-to-xml to the email and everything works fine.
The problem is the conversion-class! It cant handle umlauts or other county specific encoding.
The content-conversion from the fileadapter works. The module in the email adapter fails.
Can you confirm this?
ok, we should update our XI
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.