cancel
Showing results for 
Search instead for 
Did you mean: 

User id of the webservice caller

arunneerolil
Contributor
0 Kudos

Hi all,

Is there any way to capture the userid of the webservice caller ??

If we are calling a webservice in XI we should give the uid/pwd for XI.

We need to get this userid in message mapping.

Thanks in Advance,

Rgds

Chemmanz

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Plz see the below links

/people/sap.user72/blog/2004/11/30/user-mapping-based-single-sign-on

dynamic URL -

Dynamic configuration payload -

https://media.sdn.sap.com/javadocs/NW04/SPS15/pi/com/sap/aii/mapping/api/DynamicConfiguration.html

Regards

Chilla

bhavesh_kantilal
Active Contributor
0 Kudos

hmm..

There is a concept of Access User List whereby you can restrict the users accessing the message. Is that what you want?

Also, the User Id is a part of the RunTime header and I dont think this can be accessed in the mapping.

Regards

Bhavesh

arunneerolil
Contributor
0 Kudos

hi bhavesh,

In our case we need to process the webservice requests of different users in a different way. So we need to use their userids in mapping.

Just like we are accessing the file name from the sender file adapter, we need the

userid of the webservice caller from the Soap sender adapter.

rgds

Chemmanz

bhavesh_kantilal
Active Contributor
0 Kudos

http://help.sap.com/saphelp_nw2004s/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm

this link provides the list of RunTimeParameters that can be accessed.And this does not contain the UserName.

Also, another interesting factor is that In the Receiver Determination --> Context Object 's you have the Context Object called<b> SRemoteuser</b> . Am not sure if it refers to the Triggering user but it is worth giving a try and checking if it refers to the User.

If it does then you can have multiple Inbound Receivers / Interfaces and then route it to the corresponding mapping program as you want.

Regards

Bhavesh

Former Member
0 Kudos

Hi,

In mappin you can get the sender user name via user.name .use this in the below link / code

/people/sravya.talanki2/blog/2006/12/20/accessing-system-parameters-in-mapping-runtime

Regards

Chilla

bhavesh_kantilal
Active Contributor
0 Kudos

Dug deepers and found the solution

In Sender SOAP adapter, select options,

1. Select Adapter Specific Attributes

2. Variable Transport Binding

Now, use this code to read the user name,.

String SOAPurl="http:/"+"/sap.com/xi/XI/System/SOAP";

DynamicConfigurationKey keyURL = DynamicConfigurationKey.create(SOAPurl,"SRemoteUser");

// access dynamic configuration

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

// get value

String user=conf.get(key);

Regards

Bhavesh

Former Member
0 Kudos

Hi,

Just change the above

String SOAPurl="http:/"+"/sap.com/xi/XI/System/SOAP";

DynamicConfigurationKey keyURL = DynamicConfigurationKey.create(SOAPurl,"user.name");

// access dynamic configuration

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

// get value

String user=conf.get(key);

Regards

Chilla

bhavesh_kantilal
Active Contributor
0 Kudos

Chilla,

<i>DynamicConfigurationKey keyURL = DynamicConfigurationKey.create(SOAPurl<b>,"user.name"</b>);</i>

The technical name for User name is <b>SRemoteUser</b> .

Regards

Bhavesh

Former Member
0 Kudos

Hi,

yes Bhavesh , if you want to use SRemoteUser then you my have to config in Sender SOAP Adapter.

See the below link

http://help.sap.com/saphelp_nw04/helpdata/en/fc/5ad93f130f9215e10000000a155106/content.htm

But user.name can be accessed as runtime variable

Regards

Chilla

arunneerolil
Contributor
0 Kudos

hi ,

I have tried with

<b>user.name</b>

and

<b>SRemoteUser</b>

both are returning only <b>null</b> values.

Any more clues.

Thanks in Advance

Chemmanz

Former Member
0 Kudos

Hi,

Adapter-Specific Message Attributes

To store adapter attributes in the message header of the XI message, set the Set Adapter-Specific Message Attributes indicator.

The following attributes are added to the XI message header if the sender makes them available, and if the Variable Transport Binding indicator is set.

Name

Technical Name

Remote User

SRemoteUser

Remote Host

SRemoteHost

To transfer further header fields, set the relevant indicator. You can then store the following attributes and their values in the XI message header:

Name

Technical Name

Variabler Header

XHeaderName1

Variabler Header

XHeaderName2

Variabler Header

XHeaderName3

The names of the fields and parameters must correspond to the names of the fields and parameters that also go through the HTTP request.

The attribute namespace for the adapter is http://sap.com/xi/XI/System/SOAP.

See my above link

and set it and try ..

Sure it will work either SRemoteUser : user.name

Regards

Chilla

Former Member
0 Kudos

Chilla,

Can you pls let me know where you find this user.name in documentaion? We are unable to locate it in documentation. Even in the link you have specified, I can only see SRemoteUser and not user.name.

Regards,

Jai Shankar

bhavesh_kantilal
Active Contributor
0 Kudos

Chemmanz,

Did the request hit the SOAP adapter? Or are you sending the SOAP request directly to the integration engine?

Your WSDL url should point to the Adapter Engine URL as shown in the How to use SOAP adapter document.

Also, in the corresponding Sender SOAP adapter did you select Adapter Specific Identifiers and variable transport binding?

Also, check in the SOAP header of your message in MONI in ther DynamicConfiguration are you able to see the UserName?

regards

Bhavesh

arunneerolil
Contributor
0 Kudos

hi

As per the SOAP Sender sap doc

The following attributes are added to the XI message header if the sender makes them available, and if the Variable Transport Binding indicator is set.

Name Technical Name

Remote User SRemoteUser

Remote Host SRemoteHost

i am not getting the meaning of <b>'if the sender makes them available'</b>

do we have to set these and send along with the 'SOAP Request'. ??

even i tried by appending &SRemoteUser=xx&SRemoteHost to the SOAP connection endpoint URL in XML Spy.

If i check the 'Variable Transport Binding indicator', XI is not accepting the SOAP

request, it is throwing parsing error.

Any more clues.

Thanks in Advance

Regards,

Chemmanz

<b></b>

Former Member
0 Kudos

Hi,

as per above you have to use the string "SRemoteUser" in SOAP Sender adapter specific configurations see above link , sure set it the String and try

Regards

chilla

bhavesh_kantilal
Active Contributor
0 Kudos

In the receiver SOAP adapter can you try selecting the option "Keep Headers" and give it a shot?

Regards

Bhavesh

arunneerolil
Contributor
0 Kudos

Hi All,

And we got it by setting dummy headers.

Don't know the reason y xi is behaving like tht.

Thx a lot.

Chemmanz

Former Member
0 Kudos

Hi Chemmanz

Did you get you scenario to work? I am have the same problem right now, need to extract user id form webservice requrest from MS Share Point to XI, user id is needed for authority check in R/3.

If you got this to work could you please share the configuration details?

Thanks in advance,

Margaret