cancel
Showing results for 
Search instead for 
Did you mean: 

Read user name from Header of SOAP Sender

Former Member
0 Kudos

Hi All,

Is there any way to read value of "sap-user" passed in below URL.

http://<server>:<port>/sap/xi/adapter_plain?namespace=<sender_ns>&interface=<sender_mi>&service=myse...;

I tried using DynamicConfiguration in my SOAP sender adapter with "SRemoteUser" variable, it did NOT work for me.

Are there other options like Runtime Constants in JAVA Mapping etc.

Thank you,

Smita

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor

You cannot use ASMA values of sender SOAP adapter, when you work with plain HTTP adapter.

In HTTP adapter you can read the URL parameters. I have not tested this, so I cannot garantuee that this works, but it might be worth giving a try.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan,

I tried reading 'sap-user' using URL Parameters for plain HTTP Adapter and it worked.

Thanks,

Smita

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Smitha,

Could you explain it in detail, i need to read userid info in SOAP Header and pass it to target.

Former Member
0 Kudos

Hi Vishwanath,

If user name is passed in header within standard field 'sap-user' in case of sender SOAP adapter, it can be read using DynamicConfiguration.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP","SRemoteUser");

String userName = conf.get(key);

Further you can map this retrieved value to required field from target structure.

Hope this explanation helps.

-Smita

Former Member
0 Kudos

Hi Smita,

I am not sure if this is the question you are asking for sender SOAP adapter or HTTP Adapter?

Please refer the below statement.

SOAP Adapter:

The inbound address for SOAP messages is: http://host:port/XISOAPAdapter/MessageServlet?channel=party:service:channel

HTTP Adapter:

The plain HTTP adapter is used by external systems to connect to the Integration Engine using the native HTTP interface (HTTP payload without SOAP envelope). These systems are connected using the Internet communication framework of the SAP Web Application Server. For this purpose, the Integration Engine HTTP inbound channel contains an HTTP service delivered by SAP, called /sap/xi/adapter_plain.

Queries entering the plain HTTP adapter must have the following syntax:

http://<hostname:port>/<path>?<query-string>;

The query string contains the following data:

● Sender namespace ?namespace=<namespace>

●Sender interface &interface=<interface>

These details define the sender interface.

●Sender service &service=<service>

Specifies the sender service.

●Sender party (optional) &party=<party>

●Sender agency (optional) &agency=<agency>

●Sender scheme (optional) &scheme=<scheme>

If you are asking for HTTP Adapter, then I can tell you.

Please confirm.

Regards

B.Dheepa

Former Member
0 Kudos

Hi Carlos,

Problem is resolved. You can use URL-Parameters to read value of 'sap-user' in case of HTTP Adapter.

In case of SOAP Adapter, ASMA values of SOAP (SRemoteUser) can be used.

Thanks,

Smita

Former Member
0 Kudos

Hi Smita, how did you resolve this problem or did you? I have the same...

Thanks.

Carlos