Skip to Content
0

SAP PI: How to use Login-User in Message-Mapping (SOAP) at Runtime

Feb 13 at 08:06 AM

61

avatar image
Former Member

Good Morning,

I´m searching for a solution to find out which user has effected the incoming soap-message in the PI (Dual Stack). This should be read out at runtime in the message mapping (for example java-mapping).


I want a general EDI-Input Scenario for external partners and so i need to know at runtime which user has sent the message. The information i need is written in the Header-Information of the SOAP-Message in the bullet "RunTime".


Any idea how a java-mapping for example could look like?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Evgeniy Kolmakov Feb 13 at 09:49 AM
1

Hi Max!

Sender SOAP adapter has an ASMA attribute called "SRemoteUser". Didn't you try to make use of it?

Regards, Evgeniy.

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Evgeniy,

thank you for the fast answer.

I´ve read about that attribute, but i can´t bring it realy in connection to my problem.

How can i make use of it in the message mapping or use it to proove if the customer-nr in the payload is right to the User? Is it possible to read this attribute with java-Mapping?

Regards, Max.

0

Hi Max!

These attributes are sent within message header in "Dynamic Attributes" section:

Sure, you can read it using any kind of mapping. Here is the code snippet for pure java mapping:

public void transform(TransformationInput in, TransformationOutput out)throws StreamTransformationException {
DynamicConfiguration dc = in.getDynamicConfiguration();
DynamicConfigurationKey remUsrKey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP", "SRemoteUser");
String remoteUser = dc.get(remUsrKey);
}

Regards, Evgeniy.

soap-asma.png (14.1 kB)
1
Former Member

Hi Evgeniy,


perfect. Thank you. I searched at the wrong place. I looked at message-mapping instead of mapping-program in operation mapping. My fault.

Regards, Max

0