on 03-07-2012 7:07 AM
Hi,
I have written customized adaptor module and trying to set the FileName to Dynamic Configuration object. But it is throwing error.
I used the below code:
{
Message msg = null;
MessagePropertyKey key= new MessagePropertyKey("http://sap.com/xi/XI/System/File","FileName");
msg.setMessageProperty(key,"Testing");
moduledata.setPrincipleParameter(msg);
}
I have enabled "FileName" the ASMA(adapter specific message attribute) in receiver communication channel. But it is throwing the below exception.
"DynamicConfigurationException:: The adapter message property "FileName" was specified as mandatory element, but was not supplied in XIMessageHeader".
Working on PI7.1.
Please let me know, if i need to do any changes.
Check your XI headers whether the ASMA for Filename is properly set.
Also when calling MessagePropertyKey it should be MessagePropertyKey("FileName","http://sap.com/xi/XI/System/File")
Hope that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
"DynamicConfigurationException:: The adapter message property "FileName" was specified as mandatory element, but was not supplied in XIMessageHeader".
I used the below code:
{
Message msg = null;
MessagePropertyKey key= new MessagePropertyKey("http://sap.com/xi/XI/System/File","FileName");
msg.setMessageProperty(key,"Testing");
moduledata.setPrincipleParameter(msg);
}]\
just you have to use below code insted of what ever u wrote the code.
String DynamicConfig(String a, Container container) throws StreamTransformationException{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(key,a);
return "";
}
and in Receiver file communication channel , just you have to enable ASMA and file name.
Note:
if Ur scenario is File To File then just enable Asma and file name in both sender and receiver adapters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this:
MessagePropertyKey mpk = new MessagePropertyKey("FileName","http://sap.com/xi/XI/System/File");
msg.setMessageProperty("http://sap.com/xi/XI/System/File","FileName","Testing");
chk my wiki this may be helpful for setting dynamic file name using adapter module:
http://wiki.sdn.sap.com/wiki/display/Snippets/DynamicfilenameinaFiletoFilepassthroughscenario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit,
I have already tested with below code.
This works for PI7.0.
MessagePropertyKey mpk = new MessagePropertyKey("FileName","http://sap.com/xi/XI/System/File");
msg.setMessageProperty("http://sap.com/xi/XI/System/File","FileName","Testing");
But in PI 7.1 msg.setMessageProperty("http://sap.com/xi/XI/System/File","FileName","Testing"); is deprecated.
we have msg.setMessageProperty(key,value); where is key= MessagePropertyKey and value=filename...
Hi,
It looks like the file name you are trying to set is not captured by the receiver adapter. Try changing the code to the following:
String filename = new String("");
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
filename = "somefilename.xml"; //put your own name here
conf1.put(key1,filename);
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can use udf level only.....
String DynamicConfig(String a, Container container) throws StreamTransformationException{
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
conf.put(key,a);
return "";
}
and in Receiver file communication channel , just you have to enable ASMA and file name.
Hii Madhu,
Basically you are trying to set FileName to Dynamic Config Object. You've mentioned that in Reciever Comm Channel >ASMA (Adapter Specific Message Attributes)> FileName is enabled. Is the same enabled in Sender Comm Channel too ? For ASMA, the same set of parameters are needed to be checked in both the comm channels. I think this should resolve ur issue.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.