on 09-30-2015 1:57 PM
Hi All,
We have a requirement where we have to change the file extension after PGP encryption.
We will not be having only ID objects, as this is a pass-through case.
Ex: If we have a file namely "ABC.txt" at source then PI should pick this file, apply encryption using module tab in Communication
channel and then change the extension of file i.e. at target folder it should be like "ABC.pgp".
Please help
P.S. Here file name is random.
Regards,
Aamir
hi aamir khan
I have the same problem of generating a file with ext pgp after encryption from PI, how did you solve it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Aamir,
Please follow these blogs
Dynamic file name for pass-through scenario
package javaapplication1;
import com.sap.aii.mapping.api.*;
import java.io.*;
public class DynamicFileName_JavaMap {
public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException {
try {
InputStream inputstream = transformationInput.getInputPayload().getInputStream();
OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();
// a) Set Output File name
DynamicConfiguration conf = (DynamicConfiguration) transformationInput.getInputHeader().getAll().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
String FileName = conf.get(key);
FileName = FileName.replace(".txt", ".pgp");
conf.put(key, FileName);
// b) Just copy Input file content to Output file content
byte[] b = new byte[inputstream.available()];
inputstream.read(b);
outputstream.write(b);
} catch (Exception exception) {
throw new StreamTransformationException(exception.toString());
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aamir,
You can try with an OS command, check also this thread: Need Help on Dynamic File Name | SCN
I already tried with DynamicConfigurationBean but this doesn't work for me
Could you share the exception and your configuration?, we will can help you better.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aamir,
Can you try using Dynamic Configuration Bean.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Aamir,
Refer the below links
Dynamic file name in a File to File pass through scenario - Code Gallery - SCN Wiki
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghu,
I am getting below error while using DynamicAttributeChangeBean:
Transmitting the message to endpoint <local> using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.services.jndi.persistent.exceptions720.NameNotFoundException: Object not found in lookup of DynamicAttributeChangeBean.
Thanks..Aamir
Aamir,
change the namespace to http://sap.com/xi/XI/System/File
Aamir
DynamicAttributeChangeBean is a custom adapter module so you need to deploy it into your system before you can use it.
Check out the Source Code section of the article on how to deploy it. If your system is on PI 7.31 SP13 or above, you can directly download the EAR file to deploy.
Rgds
Eng Swee
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.