cancel
Showing results for 
Search instead for 
Did you mean: 

Encode Bytecode in source field to base64 in target field

Former Member
0 Kudos

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!

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hmm, we will go for a pure Java Mapping now, as I am still not able to use imported base64 classes in the UDF. I will give a short feedback when testing was sucessful.

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

You should consider com.sap.aii.utilxi.server.jar in PI 7.1

aii_utilxi_misc.jar --> Its available in PI7.0 and repalced by com.sap.aii.utilxi.server.jar in PI 7.1

Thanks

Swarup

Former Member
0 Kudos

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?