on 06-21-2006 5:00 PM
Hi All,
We are writing an adapter module for one of our receiver adapter.
On the Sender side we have a file adapter whose adapter specific properties are checked. So the message has the file name in the Dynamic configuration.
Now we need to read this file name from dynamic configuration inside our adapter module for receiver adapter.
If any one can tell us how to do this we would be really thankful.
Thanks
Abinash
Starting with SP16 you find following method in Interface Message:
java.lang.String getMessageProperty(java.lang.String namespace, java.lang.String name)
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhinash,
take a look at this document and check if it has answer to your problem.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
<i>Now we need to read this file name from dynamic configuration inside our adapter module for receiver adapter.</i>
>>Do you need to get dynamic file name in the target as the same as input file name. Then refer this blog-
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
>>If you want to part of the payload then map it in the mapping.
Using Module-
/people/sap.user72/blog/2005/07/15/copy-a-file-with-same-filename-using-xi
Regards,
Moorthy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
My requirement is I need to read the file name from Dynamic configuration in the SOAP header inside my adapter module.
Since we are not going to use mapping we are trying to do it inside the custom adapter module.
Krishna, we don't have the file adapter on the receiver side rather it's an email adapter. We are using a dummy interface to get the file from sender and send the file as attachment to the receiver through Mail adapter. Now for this we need to have the attachment name same as the file name.
Now if you want to use the follwoing code:
DynamicConfiguration conf = (DynamicConfiguration) param.get(
StreamTransformationConstants.DYNAMIC_CONFIGURATION);
Then what should be the corresponding library for this inside adapter framework.
If some one can help us on this I would be really thankful.
Thanks
Abinash
Hi Bhavesh,
But still I am confused from where we will get the object of <b>param</b>.
or
How can we get the cotainer object for doing the following:
DynamicConfiguration conf = (DynamicConfiguration)
container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
Thanks
Abinash
Bhavesh,
When we use the follwoing code inside mapping
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
the conf object gets populated
but inside our adapter module we ares using
Map param;
DynamicConfiguration conf = (DynamicConfiguration)
param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create
("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
Now the question is from where the <b>object of par</b>am will initialize.
I think we need to get container object from some where, but don't know how to get it as inside mapping the container object is passed as method argument.
Thanks
Abinash
Hello Bhavesh,
I have already tried that. I am getting <b>Exception caught by adapter framework: null</b>.
So I think someway we have to find out how to acess the SOAP header informations in side a adpter module that will be usred on the reciver side.
I really appriciate your effort and time on this. For this I am giving you some points. Please let me know if you find any solution to this.
Hi Abhinash,
Maybe you will have to use the Mapping after all and get the FileName into the mapping.
If you are using a FILE to FILE scenario, then no mapping is also needed, just enable the ADAPTER SPECIFIC IDENTIFIERS in both your Sender and Receiver File adapter.
Can you give us more details on what your entire proecess flow is so that maybe an alternative can be looked at?
Regards,
Bhavesh
Before XI executes the execute method it executes the method setParameter(Map arg0)
so in your class should be something like this
public class MyMapping implements StreamTransformation {
private Map map = null;
public void execute(InputStream in, OutputStream out) {
Blah blah blah....
}
public void setParameter(Map arg0) {
this.map = arg0;
}
So when you are in the execute method you already have initializated the map parameter.
Hope it works
Regards.
Hi,
Try this code,
private Map param;
// access dynamic configuration
DynamicConfiguration conf = (DynamicConfiguration) param.get(
StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
// read value
String Filename = conf.get(KEY_FILENAME);
Regards,
Bhavesh
Message was edited by: Bhavesh Kantilal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.