cancel
Showing results for 
Search instead for 
Did you mean: 

Access of XI Message Header Information

Former Member
0 Kudos

Hi,

is there a way to access the XI message header information in user defined Java mapping functions or custom mapping programs? I know how to access the dynamic configuration but not the other or self added header parts.

Kind regards,

Heiko

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

if you want to get values from the dynamic configuration

you can use the code from my weblog:

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

you can use it in both: user defined functions

in message mapping and in java mappings

Regards,

michal

Former Member
0 Kudos

Hi Michal,

thank's for your remark. I know how to access the dynamic configuration. I would like to know whether it is possible to access custom data contained in the XI message header but not in the dynamic configuration.

Cheers,

Heiko

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

If you are talking specifically in terms of the SOAP adapter , select the option KEEP HEADER in the Sender SOAP adapter and this will pass the SOAP header also as a part of the payload and then you can access this using the Mapping ( Java Mapping). AM not sure if there is a standrad class to do this.

Regards,

Bhavesh

Former Member
0 Kudos

Thank's Bhavesh,

but this would make a change of the underlying datatype in SAP XI necessary. I would like to avoid this and pass additional data in a more none intrusive way.

Cheers,

Heiko

Answers (2)

Answers (2)

henrique_pinto
Active Contributor
0 Kudos

For the sender SOAP adapter, try checking use adapter specific message atributes, variable binding, and then set XHeaderName1 with the name of the header you're expecting.

You can later read this header with regular dynamic configuration methods.

Check out this link: http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/5ad93f130f9215e10000000a155106/content.htm

Regards,

Henrique.

Former Member
0 Kudos

Hi Henrique,

thank's for your remark. So additional data has to be added to the dynamic configuration.

Cheers,

Heiko

henrique_pinto
Active Contributor
0 Kudos

Not actually. If you just want to access the attribute value (since you are writing the header value in a specific attribute) just use .get method for dynamic configuration object, like in this example:

http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

The difference is that for your case the namespace will be http://sap.com/xi/XI/System/SOAP and the technical name will be XHeaderName1.

Regards,

Henrique.

Former Member
0 Kudos

Hi Heiko,

here a sample for accessing the message-id:

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

String msgid;

java.util.Map map;

map = container.getTransformationParameters();

msgid = (String) map.get(StreamTransformationConstants.MESSAGE_ID);

return msgid;

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

See also:

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

Regards Mario

Former Member
0 Kudos

Hi Mario,

that's not quite what I have in mind. Suppose I have got a web service client which puts some information - e.g. a session id - in the SOAP header. This session ID will appear in the header section of the XI message. But there is no API to retrieve it.

Cheers,

Heiko