on 08-27-2009 5:01 PM
Hello,
I have already posted a similar question regarding base64 encoding of attachment. However now the bytecode is sent in a single field in the source message. This bytecode has to be encoded in base64.
So far I have not found any solution to do so. I have read about the following API com.sap.aii.utilxi.base64.api.Base64 which should contain two static methods for encoding end decoding.
However the package cannot be found when trying to import it into an UDF. As this API is not documented, could it be that it is not available anymore on PI 7.1?
What other possibilites do I have? Do you have any idea? I
Thank you very much!
Maybe you can use the classes sun.misc.base64encoder and sun.misc.base64decoder
I have tested the classes in a UDF, so I think you can use them also in a Java mapping.
See this blog:
/people/farooq.farooqui3/blog/2008/05/22/decode-base64-incoming-encoded-information-in-sap-xipi-using-java-mapping
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
yes, the sun encoder works also in our UDF. Thank you!
For now the solution is fine, however what still is causing some concern is the fact that this librabry is not officially supported.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian,
com.sap.aii.utilxi.base64.api.Base64 is no official API, so there is no official documentation on this. Also, if you use this, there can be a possibility that changes might occur in this class without any notice.
This class has two static methods:
String encode(byte[]) // binary -> base64
byte[] decode(String) // base64 -> binary
Try looking for this class in aii_utilxi_misc.jar, which can be found on PI server - C:\usr\sap\*\*\j2ee\cluster\server0\bin\ext\com.sap.xi.util.misc
Hope this helps.
Regards,
Neetesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I tried to find the class in the directory you mentioned.
However I have not found aii_utilxi_misc.jar in this directory. Only the following jars:
com.sap.aii.utilxi.server.jar
com.sap.aii.proxy.gen.jar
com.sap.aii.utilxi.core.jar
This might be the reason why it was not found. Maybe it is not part of 7.1. anymore? Do you have any other ideas on how to solve the base64 problem?
Edited by: Florian Guppenberger on Aug 28, 2009 11:17 AM
Thank you!
Hmm, I found another thing, obviously it is only possible to have data types int, float and String as input for an UDF? In this case I think I cannot use an UDF at all to encode one element of a message to encode to base64?
Is that correct?
But if I go for a Java Mapping how can I encode just a single element?
Do you have any advice on that?
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.