cancel
Showing results for 
Search instead for 
Did you mean: 

How to compile java code for xi purpose???

Former Member
0 Kudos

Hi,

I am doing some encryption technique by using some sap document. In this they given one Java program and they told to compile and to use that program. In this program there is one line like below

decoded = com.sap.aii.utilxi.base64.api.Base64.decode(data);

when i am trying to compile that program in Eclipse it is unable to identify com.sap.aii........etc . The below is the total program given by them. Can any body compile below program and send it to me along with .class file and jar files in zip format. My email id is madhu.psr@gmail.com

-


public class Base64Convert implements StreamTransformation {

static final String DELIMITER = "\" <>?=";

private Map param = null;

public void setParameter (Map param) {

this.param = param;

if (param == null) {

this.param = new HashMap();

}

}

public void execute(InputStream in, OutputStream out) {

char[] xmlChar = null;

String xmlString = null;

String data = "";

byte[] decoded = null;

try {

xmlChar = getChar(in);

xmlString = new String(xmlChar);

data = getTokenValue(xmlString, "data");

decoded = com.sap.aii.utilxi.base64.api.Base64.decode(data);

}

catch (Exception ex) {

ex.printStackTrace();

}

finally {

writeOutStream(out, decoded);

}

}

-


Thanks and Regards

madhusudhan

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi,i'm trying to run the code as mentioned by mentioned by madhu.

but i'm facing problem with this particular line of code

decoded = com.sap.aii.utilxi.base64.api.Base64.decode(data);

Alos facing problem with the import stmt

import com.sap.aii.mapping.api.StreamTransformation;

i have already imported the the jar file aii_map_api.jar.

Iam trying to run this entire code in NWDS.

Kindly help me out with a solution.

regards

madhu

madhusudana_reddy2
Contributor
0 Kudos

Hi All,

finally i completed this by developing EJB Module, instead of Java Mapping. For this we require some jar file from our J2EE engine. After uploading the jar file (com.sap.aii.utilxi.base64.api) into Eclipse( Java Development Tool ), the error was disappeared.

thanks,

Madhusudhan.

ravi_raman2
Active Contributor
0 Kudos

Madhu,

THe issue you are facing is since you dont have the jar files your program references in your classpath. Solution.

1) Install java 1.4.2 SDK if you dont have it on your system.

2) copy the com.sap.aii jar file to your classpath on the system.

3) javac Base64Convert.java..

that should fix your problem.

Regards

Ravi Raman

Former Member
0 Kudos

Hi madhu !

I see that you are trying to create a Java Mapping (it implements StreamTransformation). Is this what you are trying to do ? to encrypt during mapping?

Check this links:

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/binary%2bconversion%2bin%2bxi%2b-%2bjava...

https://www.sdn.sap.com/irj/sdn/advancedsearch?query=java%20mapping&cat=sdn_all#

Also search for "java mapping" in the Exchange Infrastructure forums for examples.

Last: this is a link to message level encryption, just in case:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d024ca8e-e76e-2910-c183-8ea4ba68...

Regards,

Matias.

Former Member
0 Kudos

can you not import those files into the code and compile and deploy via SDM?

They should be on you XI server.

Former Member
0 Kudos

Can you say from where i can import those files and how to import. At the same time let me know about SDM. If possible send any URL which helps me in doing this.

thanks,

Madhusudhan.