on 04-25-2007 12:24 PM
Hi,
I searched a long time at SDN but didn't found something, that solved my Problem.
My scenario:
I'm getting an mail with a pdf attached. This pdf has to be mapped to a function module with a SOLIX structure (RAW255).
1. swap the payload (PayloadSwapBean)
2. convert the attachment (MessageTransformBean) with the following parameters:
Transform.Class com.sap.aii.messaging.adapter.Conversion
Transform.ContentType text/xml
xml.conversionType SimplePlain2XML
xml.documentName MT_pdf_binary
xml.documentNamespace http://dcx.com/mhp_mail
xml.fieldNames value
xml.fieldSeparator 'nl'
xml.processFieldNames fromConfiguration
xml.structureTitle line
3. the message type of the input data:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_pdf_binary xmlns:ns0="http://xxx">
<line>
<value>aaaa</value>
</line>
<line>
<value>bbbb</value>
</line>
</ns0:MT_pdf_binary>
4. in the montior i can see the pdf line by line in the xml doc. the field "value" is type base64binary
5. i created a mapping, which maps line by line to the fm
6. when i execute (test and the mapping, i get the following result:
Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0x10(:main:, row:49, col:14) com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0x10(:main:, row:49, col:14)
<?xml version="1.0" encoding="utf-8"?>
<ns:MT_pdf_binary xmlns:ns="xxx">
<line>
<value>%PDF-1.5</value>
</line>
<line>
<value>% </value>
</line>
<line>
<value>1 0 obj</value>
</line>
<line>
<value><</Type/Catalog/Pages 2 0 R/Lang(de-DE) /StructTreeRoot 8 0 R/MarkInfo<</Marked true>>>></value>
</line>
<line>
<value>endobj</value>
</line>
<line>
<value>2 0 obj</value>
</line>
...
one example for a fm that use this typ of input structure is SX_OBJECT_RECEIVE in the CONTENTS_BIN table.
has anyone a idea what i have to change?
regards and thanks
jp
Your PDF is not in base64 encoding.
It is plain PDF, nothing else. Therefore you cannot do a content conversion for this.
You have to do the whole stuff in a self written adapter module.
Transform the attachment to a format that the RFC adapter needs.
If you had a Web AS > 6.20 you could use an ABAP proxy instead the RFC and handle the attachment without change.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
><i>com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: Invalid char #0x10(:main:, row:49, col:14)</i>
This error implies that the source data contains some characters that is not a valid XML chacrater.
Try opening this Source XML in an Browser like IE and check if all the charcters are displayed fine (normally non XML charcters are displayed as a square)
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhavesh,
thanks for the fast replay. the IE says, that it cannot display the file because of invalid characters.
I guess the problem the MessageTransformBean parameters. I tried diffrent content types (plain/xml binary/xml ...)
At help.sap.com are only examples for MessageTransformBean configuration.
Regards jp
Hi,
Exactly the point i was making.
The source XML is not a valid XML and so the mapping is erroring out.
You might consider wirting a Java Mapping before the graphical mapping that will search for all Non XML characters and replace them with some other value (blank maybe).
We encountered a simlar issue with file adapters when the source file had non XML and this is the solution we came to.
Regards
Bhavesh
Jorg,
Do you mean to say that you have an attachment and this attachment contains XML data?
If yes, then yes you need to use someother mapping that will be able to read the data from your PDF file.
Look into this blog,
/people/sap.user72/blog/2005/07/31/xi-read-data-from-pdf-file-in-sender-adapter
Maybe there is sometoher way as well , am not sure as I have not done much work on sender mail adapter with attachments.
regards
bhavesh
Regards
Bhavesh
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.