Question

1
Replies
837
Views
ParamKonuganti Member since 2015 4 posts
1986
Posted: 2 years ago
Last activity: 2 years 1 month ago
Closed

How to send the basic authentication credentials of a Soap Service in ServiceClient Component

Hi All,

I want to send the credentials of a SOAP Service which uses a basic authentication(username & password) using serviceClient component.

Below article clearly explains how we can pass the authorization credentials,

article link

Once we have the object of the serviceClient, I hope we can use below snippet to convert the username and password into base64 and send in authorization header.

if(PreAuthenticate)
{
NetworkCredential networkCredentials=
Credentials.GetCredential(uri,"Basic");
if(networkCredentials!=null)
{
byte[]credentialBuffer=newUTF8Encoding().GetBytes(
networkCredentials.UserName+":"+
networkCredentials.Password);
request.Headers["Authorization"]=
"Basic "+Convert.ToBase64String(credentialBuffer);
}
else
{
thrownewApplicationException("No network credentials");
}
}

can anyone please advise me how to get the object of serviceClient and use it script component.

Robotic Process Automation
Moderation Team has archived post
Share this page LinkedIn