cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver SOAP Adapter - Dynamic username & password

Former Member
0 Kudos

Hi,

I am working on a scenario where the receiver SOAP adapter will have dynamic user name & password. but the URL remains same. how do we achieve this.

Thanks,

Mahesh

Accepted Solutions (0)

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

One possible way is to use XSLT mapping and create dynamic username and password in the soap header.

Former Member
0 Kudos

Baskar,

Thanks for the reply.

Could you please provide me the XSLT code?

-Mahesh

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You could use XSLT or java mapping for this. Have you seen this link?

You need to discuss with target system to decide the soap header message structure the way they want. So inside soap header tag you can insert user and password. Example as below

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

// comment: blah.. blah... all namespace fields then followed by declare

// comment : Declare user and password as follows

<xsl:variable name="user" select="1184282915'"/>
<xsl:variable name="pwd" select="'3252037'"/>
<xsl:template match="*">
<soap:Envelope>
<soap:Header>
<mod:channel>
<mod:b2bId>
	<xsl:value-of select="$user"/>
</mod:b2bId>
<mod:b2bPwd>
	<xsl:value-of select="$pwd"/>
</mod:b2bPwd>
</mod:channel>

..
</soap:Header>
</soap:Envelope>

Edited by: Baskar Gopal on Dec 20, 2011 11:08 AM

Former Member
0 Kudos

Baskar,

I checked your above link. in my case the username & password are not part of webservice header to use XSLT mapping.

these are the parameters that we specify on receiver soap adapter to access the webservice. and these parameters should be dynamically changed as per the input value.

Appreciate your help.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

in my case the username & password are not part of webservice header to use XSLT mapping.

these are the parameters that we specify on receiver soap adapter to access the webservice. and these parameters should be dynamically changed as per the input value

You need to use authentication keys (TAuthKey in dynamic configuration) for your requirement. There is a checkbox for this in the SOAP Receiver Adapter called Authentication Keys. There, you can only store a combination of up to 10 usernames and their equivalent passwords.

If there are more than 10 usernames/passwords here's what you can do:

1. Segregate the users according to function e.g admin, restricted, etc (max of 10) and place them in the authentication keys

2. Use a lookup (valueMapping, hashMap, etc) to determine which equivalent user in the authentication key will be used in dynamic config

Note: The approach above may not always be applicable though.

Hope this helps,

Mark

Former Member
0 Kudos

Hi Baskar,

I have checked all your Replies in SDN related to SOAP Header Creation for Wssec Web Service.

I am working on a Interface (CRM Proxy to Web Service having wssec) in PI 7.0 SP6. I have created the SOAP Header by using XSLT mapping to pass the username token and password but hardcoding user credentials in the XSLT mapping doesn't sound too neat. And transporting it from D to Q to P is even worse.

And also i have 2 username and 2 passwords to access to different instances in the same web service. So i have to pass the different Username and Password based on the Instance in SOAP header dynamically using XSLT mapping.

Therefore i request you help me out on how to pass the Username and password dynamically in the XSLT mapping to Create dynamic SOAP Header to access different instances.

If possible can you provide step-by-step aproach including XSLT mapping and Code for dynamic SOAP Header creation.

Thank you very much for your valuable inputs.

Regards,

Ajay Kodali.