Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Question Set Webservice password dynamically

More
22 Dec 2020 12:22 #1 by Meshchaninov
Set Webservice password dynamically was created by Meshchaninov
Hello,

I try to use a webservice using user/password authenification via WS Security element in WSDL metadata. Username and password must be passed via variables such as:
user : ${~/WS_USER}$
password: ${~/WS_PASSWORD}$
or
%{WS_VARPASSWORD}% if we use Variable Set
These variables are set by our process depending on the data arrived (differents logins/passwords for different datas).


So, username substituted correctly but not the password. Either "%{WS_PASSWORD}%" expression itself is written to the SOAP Header or we have an error
java.lang.NumberFormatException: For input string: "T"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Byte.parseByte(Unknown Source)
at com.indy.a.a.a.a(SourceFile:108)
at com.indy.a.a.b(SourceFile:107)
at com.indy.engine.manager.h.decryptString(SourceFile:1424)
at com.indy.engine.action.common.ActionCodeTypeI.getLocalPasswordParameter(SourceFile:2236)
at com.indy.engine.action.common.ActionCodeTypeI.getLocalPasswordParameter(SourceFile:2246)
at com.indy.engine.actionCodes.XmlToWsdlActionCodeI.prepare(SourceFile:456)
at com.indy.engine.actionCodes.XmlToWsdlActionCodeI.prepareSimpleExecuteCode(SourceFile:209)
at com.indy.engine.action.common.ActionCodeTypeI.executeCode(SourceFile:1691)
at com.indy.engine.action.common.ActionCodeTypeI.run(SourceFile:1852)
at java.lang.Thread.run(Unknown Source)

in case of "${~/WS_PASSWORD}$" variable.

How can we dynamically set passwords for WebServices correctly ?
Thank you
More
19 Jan 2021 09:40 #2 by Thomas BLETON
Replied by Thomas BLETON on topic Set Webservice password dynamically
Hi,
The variable must contain the encrypted value of the password.
You can use the Runtime command "encrypt" to get this encrypted value.