on 12-12-2014 11:56 PM
We have a scenario where we need to pick the xml file then send the same file as an attachment, but file sender will pick the file as an payload, how we can pick the xml file as an attachment to soap receiver. Do we have any standard modules for this or we need to write modules.
Use below sample Java mapping.
package javaapplication1;
import java.io.InputStream;
import java.io.OutputStream;
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
public class JavaApplication1 extends AbstractTransformation {
public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput)
throws StreamTransformationException {
try {
InputStream inputstream = transformationInput.getInputPayload().getInputStream();
OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();
// a) Just copy Input file content to Output attachment content
byte[] b = new byte[inputstream.available()];
inputstream.read(b);
transformationOutput.getOutputAttachments().create("FileAttachment", b);
// b) Populate output SOAP payload.
//Option 1: If you want input file contant as output SOAP payolad. Just write byte[] b (above) to output.
//Option 2: After this Java mapping, use another Graphiical mapping to generate SOAP payload.
outputstream.write(b); //This option 1.
} catch (Exception exception) {
getTrace().addDebugMessage(exception.getMessage());
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 Rudra Singh
Exclusion Mask option is not use, it is used to exclude particular files from the selection.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Lakshman,
Please check below link
Specifying Additional Files in the Sender File Adapter - Advanced Adapter Engine - SAP Library
U can achieve the same without AAE alos .
Got confused with exclusion mask n additonals files option
Regards,
Dear Lakshman,
Since its file to soap scenario. You can use Exclusion Mask option to add file as an attachment in file sender adapter.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.