cancel
Showing results for 
Search instead for 
Did you mean: 

File Receiver adapter module Dynamic Configuration

Former Member
0 Kudos

Hi All

I have a adapter module in a receiver file adapter. In the code I try to access the file name through dynamic configuration,The file name gets set in the mapping.

String strFileName = msg.getMessageProperty(new MessagePropertyKey("FileName","http://sap.com/xi/XI/System/File"));

When my module get executed I get error: nested exception is: java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.Message.getMessageProperty(com.sap.engine.interfaces.messaging.api.MessagePropertyKey) of an object loaded from local variable 'msg'

Is it possible to get file name in receiver adapter? if so why does this error occur?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Yes it is possible...chk this

/people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules

i guess u have added this import statement in ur code:

import com.sap.engine.interfaces.messaging.api.MessagePropertyKey;

Code will be soemthing like this (FOR PI7.1)

MessagePropertyKey mpk = new MessagePropertyKey("FileName","http://sap.com/xi/XI/System/File");

String filename = msg.getMessageProperty(mpk);

Thanks

Amit

RKothari
Contributor
0 Kudos

Hello,

Please check if you have mentioned the correct configuration on receiver channel as in the below wiki:

https://wiki.sdn.sap.com/wiki/display/XI/Combining%20three%20different%20aspects%20of%20PI%20in%20on...

-Rahul