Interface name in Adapter module
Hi Gems,
In my adapter module , i have a bean class and an other class extends AbstractTransformation with transform method.
public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException {
strReceiverInterface = (String) in.getInputHeader().getReceiverInterface();
strSenderInterface = (String) in.getInputHeader().getSenderInterface();
inTime = in.getInputHeader().getTimeSent();
From my Bean class i created an Object and fetched the interface name.. .. but at runtime interface name comes null.
Can any one tried this ever?? Please let me know ASAP..
Thanks
Prabhakar
Have a look at this:
http://help.sap.com/javadocs/NW04/current/pi/constant-values.html#com.sap.aii.mapping.api.StreamTransformationConstants.INTERFACE
and
http://help.sap.com/javadocs/NW04/current/pi/constant-values.html#com.sap.aii.mapping.api.StreamTransformationConstants.INTERFACE
Regards,
Ravi
Similar Messages
-
How to read Sender Interface name in adapter Module in PI 7.31
Hello All,
I am working on Adapter module .it accomplish to generate file with message id,message key ,sent time,received time,FromService(Business system names),toServiece(Business system name),sender interface name,receiver interface name .
i got all details in my file by calling module data by method get principal data,but i am fail to get sender interface in that file .
can you please guide me how to get sender interface name in adapter module.
I am getting some information from this following blogs
https://scn.sap.com/thread/1583665
How to read Sender Interface name in Adapter module
but i am facing same error what they faced.
Please guide me to how to get sender interface name in adapter module.
Thanks
GaneshHi Ganesh
Write a module in the sender adapter and use this piece of code
Message mes = null;
mes = (Message) inputModuleData.getPrincipalData();
String SI = mes.getAction().getName();
Also you can read the same by creating a UDF in message mapping
Following is the code
InputHeader inputHeader = container.getInputHeader();
String SI = inputHeader.getInterface() ; -
Retrieving sender Interface name in adapter module
Hi Gurus
Is there ne way we can retrieve interface name in the adapter module which is on the sender side?
I was thinking about using dynamic configuration in adapter module but I guess since container element cant be used inside adapter module.....it will be futile...
Regards
AkhilThe Receiver Determination step will be executed only after the message comes out of the Sender Adapter / Module and so , the Receiver Interface will obviously be unavailable in the Sender Module.
Regards
Bhavesh -
How to read Sender Interface name in Adapter module
I have a need to read the Sender Interface name in an adapter module that will be attached to a Sender SOAP channel. Any ideas on how this can be done.
I am familiar with the following code construct from the docs
Hashtable mp = (Hashtable)inputModuleData.getSupplementalData("module.parameters");
fileName = (String) mp.get("FileName");
What is the key name (in the hashtable) for Sender Interface name ? The docs seem to be silent on this
I dug around some and found references to "mp.context" and "message.interface". I guess I could just test this out but I dont have deploy access and I dont want to keep asking the BASIS group to deploy the module while I play around with different combinations...
So would the following work
Hashtable mp = (Hashtable)inputModuleData.getSupplementalData("mp.context");
interfaceName = (String) mp.get("message.interface");
Thank you
AnilHi Anil,
I am not sure of how to get the Sender interface name. I even tried the code that you suggested above. It gave me a null pointer exception.
I think instead of Sender Interface name you can decide upon the Sender System/Service.
To get the Sender System Name:
Object obj = null;
Message msg = null;
obj = ModuleData.getPrincipalData();
msg = (Message) obj;
String SenderSystem = msg.getFromService();
Here based on the sender system you can do your partner specific processing in Proxy. Instead of Sender Interface Name.
Hope this helps
Regards,
Aravind -
Get/set message interface name in adapter module
Hello,
From an adapter module, I'd like to get or even set the Message Interface name of the message that is handed over to the function "process" of the adapter module.
I've got two context's, sessioncontext and modulecontext. With both contexts, you can get values from that context. I'm not sure which context has the message interface name of the message currently being processed, and I'm also not sure what that value is called (moduleContext.getContextData("name");).
The reason for this is that sometimes you'd like to do something different depending on the type of message being processed.
If anyone knows how to do this, I'd be glad to hear.
Thanks in advance for any advice!
Greetings, Walter.Hi Walter,
It is fairly easy to get the interface name. When you have extracted the XIMessage there is a parameter, which allows you get the Action, where you can get the interface name.
I have tried to change the interface name. You need to create a new message an copy the content from the old message over to this. This is a little tricky and I'm not able to get any code samples for you.
/daniel -
Incompatible with interface - Exception in Adapter Module
Hi Experts,
I have a custom adapter module deployed on PI 7.1. Once i post any message, i am getting below exception in CC monitoring.
Message processing failed. Cause: java.lang.ClassCastException: class $Proxy3125_10002:sap.com/ClearModule_EAR @ com.sap.engine.boot.loader.ResourceMultiParentClassLoader @ 6daa7537 @ alive incompatible with interface com.sap.aii.af.lib.mp.module.ModuleLocal:library:com.sap.aii.af.lib @ com.sap.engine.boot.loader.ResourceMultiParentClassLoader @ 15d75e80 @ alive
I used NWDS 7.1 to develop the module.
the EJB is stateless.
Can any one have any idea about the exception.
Please help me out here.
Thx in advance,
BrianHello,
i forgot to modify the four interfaces' name when i create the EJB, ie my Bean class is "ss.cod.de.EjdBean", then the "Remote Interface" & "Home Interface" are setted respectively and defaultly as "ss.cod.de.EjdRemote" & u201Css.cod.de.EjdHomeu201D, the u201CLocal Interfaceu201D & "LocalHome Interface" are the same to the two interface above.
everything was well while i rectified all the interfaces as "com.sap.aii.af.lib.mp.module.ModuleHome", "com.sap.aii.af.lib.mp.module.ModuleLocal", "com.sap.aii.af.lib.mp.module.ModuleLocalHome" and "com.sap.aii.af.lib.mp.module.ModuleRemote".
hope its help 4 u.
good luck.
thx & br,
Brian -
How to get file name in adapter module
Hi all
Is it possible to get the file name in a adapte module? If so how can I achieve this?Hi,
Check below thread. it shows code for file name.
[Re: Query regarding Adapter Module development]
-Gouri -
PI 7.1 adapter module issue
I deoplyed my module and worked fine. now i changed some code by adding parameter to module
strModuleKey = moduleContext.getContextData("module.key");
I changed the related things in my communication channel(gave parameters)
Now, i get below error while executing...
java.lang.ClassCastException: class com.sap.aii.af.sdk.xi.mo.MessageContext:library:com.sap.aii.af.sdk.libcom.sap.engine.boot.loader.ResourceMultiParentClassLoader428c6e04alive incompatible with interface com.sap.engine.interfaces.messaging.api.Message:interface:com.sap.aii.af.ms.ifccom.sap.engine.boot.loader.ResourceMultiParentClassLoader2dd7e4d6alive
Followed the below url but in vain..
PI JAVA ADAPTER MODULE PROBLEM
Incompatible with interface - Exception in Adapter Module
Issue on developing Adapter Module
Also if you are using PI 7.1 refer to the blog:
/people/stefan.grube/blog/2008/12/11/adjust-your-pi-70-adapter-modules-for-pi-71-in-15-minutes
Please let me know if u have any other suggestions other than this...
Thanks
PrabhakarHi Venkat,
Yes, you cannot add custom modules to soap adapter.
Please refer below documentation for the same..!!
http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/8c4756224a6fb5e10000000a155369/content.htm
http://help.sap.com/saphelp_nwpi71/helpdata/EN/69/a6fb3fea9df028e10000000a1550b0/frameset.htm
Regards,
Swetha. -
Code to retrive the sender and receiver interface names using custome adapter module
Hello Team,
I want to develop an custom adapter module which could retrieve the names of the sender and receiver interfaces of the scenario and for that i am trying to use com.sap.aii.af.service.administration.api.monitoring.ProcessContextFactory.ParamSet but i don't know whether this API will support or not and also i don't know how to develop the code using this API so please suggest me some code for it so that i could retrieve the names.
Thanks you all in advance.
Regards,
Avinash.Hi,
Just ASMA setting will do the needful. Are you planning to rename your target file name. If yes then only you will require UDF.
Update: Since your directory name will be taken from source file name then you have to use mapping for this, else it will not be possible.
I don't know if creating a new module for this will help you solve the issue, but in that case rather creating adapter module, mapping will be easier.
Regards,
Sarvesh
Edited by: Sarvesh Singh on Dec 7, 2009 3:04 PM -
Sender Mail Adapter - default interface name
Hi,
I need to receive through one e-mail sender channel tree different kind of messages.
In sender mail adapter I specify ecept other parameters "Default Interface Name". When I send a message with a same as defined in an interface the message is processed correctly.
But when I send a different kind of message then I get an error : "Receiver could not be determined".
Is any way around how through one sender e-mail adapter receive a different kinds of messages ?
Thanks for any help,
MarianHello Marzian,
have you find a solution for this problem?
We're facing the same issue.
thanks,
-Peter Ha -
Setting interface name dynamically from client for SOAP Adapter...
Hi,
does anyone have experience in setting the sender interface name in the HTTP-SOAP request dynamically? I have followed the instructions in "How To Use the XI 3.0 SOAP Adapter" on page 17 (see also SAP Note 856597) which say:
"If you select Use Encoded Headers and Use Query String,
[...]The sender SOAP adapter creates the XI message header according to the
information provided in the query string. [...] In the sender SOAP adapter, you can use only some of the parameters, but the first
parameter must always be the version. For example, you send from the Web service client to the following URL: http://<host>:<j2ee-port>/XISOAPAdapter/MessageServlet?channel=<party>:<service>:<channel>&version=3.0&Interface=http%3A
%2F%2Fsap.com%2Ftest%5ETest
This will overwrite the default interface and namespace of the sender channel."
This is exactly what I need! However, what I actually get as a response following this description is a SOAP:Fault with a java.lang.StringIndexOutOfBoundsException: String index out of range: -1.
Has anyone got this to work properly?
Thanks in advance.Thank you for your input. I am using the following format for the call (with "x" standing for one letter each):
http://xix.xxx.xx.xxx:5xx00/XISOAPAdapter/MessageServlet?channel=:xx_xxx_xxx_xxxx:xx_xxx_x_SOAP_S&version=3.0&Interface=http%3A%2F%2Fxxxxxxxx.xx%2Fxxxxxx%2Fxxxxxxxxxxxxxxxxxxxxxxxx%5Exxxxxxxxxxxxxxxxxxxxxx
Anything wrong with that? With unchecked "Use Encoded Headers" and "Use Query String" it works fine (default interface) but as soon as I set these flags I get the SOAP-Fault response.
We are on XI 3.0 SPS18. -
Parameter name in module configuration of adapter module in comm channel
Hi Experts,
I have developed an adapter module to read a excel file , have used the module in the sender file adapter.
What entrie should i put in parameter name and parameter value in module configuration of adapter module in comm channel.
Im too confused,,pls helpHi Ivan,
The code is basically to read the all colums add em under xml tags and read from second row on wards the data
please find below the module data code
public ModuleData process(ModuleContext mc, ModuleData imd)throws ModuleException
Object obj = null;
Message msg = null;
MessageKey amk = null ;
amk = new MessageKey(msg.getMessageId(),msg.getMessageDirection());
Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS,"Module called");
try {
obj = imd.getPrincipalData();
msg = (Message) obj;
XMLPayload xp = msg.getDocument();
if (xp != null)
byte by[] = convert(xp.getContent());
xp.setContent(by);
imd.setPrincipalData(msg);
catch (Exception e)
return imd;
public byte[] convert(byte src[]) throws Exception
String xmldata = "";
try
ByteArrayInputStream byteArr = new ByteArrayInputStream(src);
Workbook w = Workbook.getWorkbook(byteArr);
xmldata ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"+ "<ns0:""MT_ExcelFiles"" ""xmlns:ns0=\"""urn:xyz:abc"+"\"> \n";
int a = w.getSheet(0).getRows();
int b = w.getSheet(0).getColumns();
for(int j=1;j<a;j++)
for(int i=0;i<b;i++)
xmldata = xmldata + "<"w.getSheet(0).getCell(i,0).getContents().toString()">"w.getSheet(0).getCell(i,j).getContents().toString()"</"w.getSheet(0).getCell(i,0).getContents().toString()">";
xmldata = xmldata"</ns0:""MT_ExcelFiles"+">";
w.close();
catch (Exception e)
return xmldata.getBytes(); -
Retrieving the file name in the adapter module in the sender file adapter
hi,
i need to retrieve the file name, in the adapter module. This module is placed in the sender file channel.
After the file adapter has picked up the file from the file directory, the file is placed in the archived directory.Custom adapter mofule is place in the file shanel. i need to retrieve the file name of the file in the adapter module. Is it possible to retrieve the file name?
Also is it possible to retrieve the archive directory path in module?
Regards,
MeenkashiHi Meenakshi,
I guess you are looking for this
/people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules
Regards
Suraj -
How can transfer the read file name via own developed adapter module
Hello experts,
I want to know how I can handle the following issue:
I developed a J2EE adapter module for the file adapter "sender" with the aim to read the file name of incoming files. Thereto I implement the following code like this:
public ModuleData process(ModuleContext mc, ModuleData md) throws
ModuleException
Hashtable mp = (Hashtable)
md.getSupplementalData("module.parameters");
String fileName = null;
if (mp != null)
fileName = (String) mp.get("FileName");
Now I get the filename which includes a order nr. I need this order number to call a RFC Adapter via mapping. So my question is how can transfer this order nr to the RFC adapter?
Kind regards,
FatihHi,
>> to read the file name of incoming files
Use file adapter with Adapter specific identifiers selected.
>>Thereto I implement the following code like this:
use udf in message mapping and avoid module
>>Now I get the filename which includes a order nr. I need this order number to call a RFC Adapter via mapping. So my question is how can transfer this order nr to the RFC adapter?
use RFC Look up function in message mapping...
Is module so necessary in this case???
Regards
Suraj -
USB wireless adapter - interface name keeps changing
I have used different usb wireless (G) adapters with my 12" Powerbook G4.
Each was automatically assigned an interface name (BSD) such as en2, en4.
I recently updated to a Wireless N dongle (D-Link DWA140) which works great with my new Belkin Wireless N router.
I have had a few connection problems where the dongle was named as enNull.
After rebooting and re-entering the ip address via DHCP, I noticed that the same dongle has been renamed each time e.g First as en5 then en6, 7 and 8. It's now called en10
It works fine but is it possible to reset the name/number of this wireless adaptor using something like ifconfig in the shell Or some other way. I understand that en0 is built-in ethernet and en1 is Airport. I have 2 other dongles which are still identified as en 2 and en4. But my current dongle has an inflation problem and I would like to reset it if possible to a lower number.
Is this possible or am I mad to even consider it?
any help welcome.
Johnratcheer wrote:Inxsible, no, it is a PCI card. I have booted Arch twice, today. One time it got wlan0, the other time wlp6s0. I ended up just creating two scripts, wlan0_start and wlp6s0_start
That is very strange that PCI cards would keep changing names between reboots. Maybe you should investigate that to figure out what's going on. Check the dmesg and journalctl after each reboot and see what the interface is named as. Maybe that will give you some clues as to what "external" program is responsible in naming the interfaces.
Maybe you are looking for
-
Satellite P300-18M - VGA to S-Video / RCA cable - No Picture on TV
Hi, First of all, I am trying to use my other laptop (Dell Lattitude D630) I with my TV, however, this other laptop only has a VGA output. So I bought a VGA to S-Video and RCA adapter from e-Bay: [Picture|http://members.lycos.co.uk/jtfearnley/Hosting
-
Will I be able to sync on both mac and pc?
I'm planning to buy an iPod but right now, I don't have access to my MBP (which I primarily use) and thought that I could sync my stuff from the PC. I'll eventually get my MBP back and would like to use it there. Is it possible to sync on both a Mac
-
DOM parsing In Applet (URgent)
Is it possible to implement DOM parsing in Applet? I am getting classnotfoundException . I am giving the code below. pl read the code. Applet.(parserapplet.java) ========================= import java.io.*; import java.awt.*; import java.net.*; import
-
SWF load a XML on an other server = BUG
Hi AS3 fellaz, All sources availbale here : http://www.tapiocadesign.com/prods/xstrata/_CROSS_DOMAIN_EXEMPLE.zip MY GOAL : from a flash(swf) on server A, I want to download an XML file on server B. MY PROBLEM : it doesn t work 1 - I use the Class URL
-
Best approach for hyper-v infrastructure
Hi, We are managing an hyper-v infrastructure compose of 5 hyper-v physical hosts running Windows Server 2008 R2, this servers are in an active directory, but the virtual machines running on this hyper-v hosts are in different active directory, Is t