on 01-29-2013 8:16 AM
Hi
I've a secenerio where no mapping involved. I simply should get the files from vendor's SFTP server and store the files with the same filename in local UNIX server.
It is working when it is File sender and File receiver adatper. I followed the same setup(i.e.,in the ASMA section) in SAP's new SFTP Sender adapter but I see the below error when the File Receiver adatper trying to store the same file in my local UNIX server.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but was not supplied in the XI Message header
MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but was not supplied in the XI Message header
Exception caught by adapter framework: The Adapter Message Property 'FileName' was configured as mandatory element, but was not supplied in the XI Message header
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks,
raj.
Hi Raj,
Are you trying to create file name dynamically or did you mention file name in Channel?
Please go through the below blog for more details.
Regards,
Naveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Do as below,
1.In ESR create only an imported archive with code for dynamic config, a sample of which is given below, create an operation mapping but without existing service Interfaces..that is type in any dummy names & a real namespace in operation mapping & add the imported archive with Java mapping.
2. In ID, create sender & receiver Channels & Select adapter specific attributes in both.
3. Create a configuration, with the dummy service Interfaces. Select the operation mapping. As the service Interfaces do not exist, you have to type in the names manually.
Here is a sample code for your Java mapping. It might not be completely as per you requirement, but you can modify it:
package com.sap.pi.java.mapping;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.DynamicConfiguration;
import com.sap.aii.mapping.api.DynamicConfigurationKey;
import com.sap.aii.mapping.api.StreamTransformationConstants;
import com.sap.aii.mapping.api.StreamTransformationException;
import com.sap.aii.mapping.api.TransformationInput;
import com.sap.aii.mapping.api.TransformationOutput;
public class DynamicFileName extends AbstractTransformation{
public void transform(TransformationInput transformationInput, TransformationOutput transformationOutput) throws StreamTransformationException
{
String oldFilename = "";
String newFilename = "";
try
{
InputStream inputstream = transformationInput.getInputPayload().getInputStream();
OutputStream outputstream = transformationOutput.getOutputPayload().getOutputStream();
Map mapParameters = (Map) transformationInput.getInputHeader().getAll();
mapParameters.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic",StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
DynamicConfiguration conf = (DynamicConfiguration) mapParameters.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
String FileName = conf.get(key);
conf.put(key, Filename);
byte[] b = new byte[inputstream.available()];
inputstream.read(b);
outputstream.write(b);
}
catch (Exception exception)
{
getTrace().addDebugMessage(exception.getMessage());
throw new StreamTransformationException(exception.toString());
}
}
}
You may have to modify it since you may not need all this stuff,but it might help you a bit.
Hi Adarsh, just including the http://sap.com/xi/XI/System/File in the ASMA namespace resolved my issue. Anyway, thanks for your reply.
Thanks to everyone on this thread for the useful information. I, too, had the same issue when moving 3 separate files with the SFTP adapter, but trying to keep same filename. Our ASMA included just http://sap.com/xi/XI/System and was throwing the same error in the Message Monitor. I do not understand why, but just by adding 'File' to make it http://sap.com/xi/XI/System/File resolved our issue and they were able to land.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.