cancel
Showing results for 
Search instead for 
Did you mean: 

Parameters retrieval in adapter module

Former Member
0 Kudos

I want to retrieve following details in an adapter module

1) Sender Service : message.getFromService().getName()

2) Sender Interface :

3) Sender Namespace :

4) Reciever Service : message.getToService().getName()

5) Reciever Namespace :

6) Reciever Interface :

How can i retrieve 2,3,5 & 6?

Regards,

Amol

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Amol,

Check this code fragment to get the Interface where the module is configured(outbound or inbound). It basically uses the Message Interface.


Object obj = md.getPrincipalData();
com.sap.aii.af.ra.ms.api.Message msg = (Message) obj;             
String interrface = msg.getAction().getName();

For Namespace check on the Action Object for more i hope it is

msg.getAction().getType();

I am not sure check it out and get back.

Regards,

Sudharshan

Former Member
0 Kudos

when you say the container? where do u instantiate the container? is it a java container... if not, from which import/package we can get this container..

I was trying to write a code for this in netweaver.. but it shows container is not imported anywhere.. any suggestion

thanks-Gopal

Former Member
0 Kudos

My suggestion it´s to write the information you need on specifig tag in the payload, during the message mapping, with a custom function like this:

********************************************

String namespace;

java.util.Map map;

map = container.getTransformationParameters();

namespace = (String) map.get(StreamTransformationConstants.INTERFACE_NAMESPACE);

return namespace;

********************************************

For more information:

http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm

After this you can read the informations in the adapter module, and delete the added tag in order to have a clean payload without the additional parameters