cancel
Showing results for 
Search instead for 
Did you mean: 

Converting PI7.0 Modules to PI 7.11

laxman_molugu
Participant
0 Kudos

Hi,

I have a module code for altering the message headers like InterfaceName, namespace by using XMBMessage classes. When we upgrade our code doesn't work anymore, getting classcast Exceptions.

...

import com.sap.aii.adapter.xi.ms.XIMessage;

import com.sap.aii.af.sdk.xi.mo.xmb.XMBMessage;

...

public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {

obj = inputModuleData.getPrincipalData();

  .......

XIMessage xiMsg = (XIMessage)obj; >>>> Getting ClassCast Exception


XMBMessage xmbMsg = (XMBMessage)xiMsg.getXMBMessage();

xmbMsg.setInterface("TestProxy_In", "http://saanvi.com/pi101/proxy00");

I am able to compile but getting runtime errors, did anyone successfully upgraded to 7.11? what was the code change and it is very important that  I need to set the InterfaceName in the module like I was using XMBMessage Class

Thanks,

Laxman

Accepted Solutions (0)

Answers (2)

Answers (2)

iaki_vila
Active Contributor
0 Kudos

Hi Laxman,

Perhaps you already have read this document http://scn.sap.com/docs/DOC-16233. If you dont read it, you can check the step by step procedure to adapter migration.

Regards

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Laxman,

Can you try:

public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {

     Message msg = null;

     MessagePropertyKey mpk = null;

     try{

          msg = (Message) inputModuleData.getPrincipalData();

          mpk = new MessagePropertyKey("TestProxy_In", "http://saanvi.com/pi101/proxy00");

          msg.setMessageProperty(mpk, "INTERFACE");

I have not tried it though. Here is a sample blog for PI 7.1 Adapter Module development http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e674...

Regards,

Mark