Skip to Content
Author's profile photo Former Member

Digest: Dynamic username and password in soap receiver adapter


this is just a short summary on how to use dynamic username and password with soap adapter.

Generally the feature is documented in sap help, see under “Define Adapter-Specific Message Properties” and “Enter and Display Authentication Keys”.

You basically use the feature of dynamic header attributes. So first of all you have to set these attributes. You can do so for example with a user defined function in your mapping:

  DynamicConfigurationKey key = DynamicConfigurationKey.create(““, “TAuthKey”);

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

  conf.put (key, “SAP_PI_APPL_USER”);

This means you are setting the dynamic attribute TAuthKey. The value will be the actual username that shall be used in communication. The same way you can also set all the other attributes like url, proxy user, proxy as documented in the help.

The password however is not set as header attribute (for security reasons) but must be configured explicitly in the integration directory. Check “Use Adapter-Specific Message Attributes”, “Variable Transport Binding” and “View Authorization Keys”. Enter username/password pairs. Note that the key will be the username (SAP_PI_APPL_USER in our example). :


The unfortunate thing is that you can enter only up to ten different users. I really have no idea why SAP put that restriction on the feature. It would be so easy to provide a table entry here. Anyway I found that the documentation was insufficient on the matter and I hope this may be helpful.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Xiaobing Huang
      Xiaobing Huang

      Did you ever try to set logon language dynamically if choose SOAP receiver adapter with XI message protocol to communicate with SAP system by proxy?

      Normally we will set username, password, and language in SOAP receiver adapter, But sometimes want to get response message which is language-dependent, such as: response message may include some text field. And the language field is from request message.

      Unfortunately did't find a way to set logon language dynamically. Of course, we can create several SOAP receiver adapter with different logon language separately.

      Instead we set locale in proxy class.

      Hope you can provide me some clue! ^.^



      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Interesting question because that is the same requirement we are facing: We have services that are locale dependant because of localized texts and printer setup.

      1. The simple answer is no, we have not tried to use XI 3.0 protocol but I guess it is not possible to set the user and logon language dynamically.
      2. I also see the problem that in case of asynchronous communication the service execution is done by the qRFC scheduler and hence with a different user context.
      3. I have not tested yet but I think setting the locale in the implementation is the best way to address the requirement. I understand from your comment that this is what you do. How did you implement it? By using SET LOCALE LANGUAGE?

      Thanks anyway for your comment!

      Author's profile photo Xiaobing Huang
      Xiaobing Huang

      Yes, by using ABAP statement: set locale language.