Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
How can we find those properties in serviceClient component to enter the username and password for the service ?
Hello,
We have created a SOAP service in Pega PRPC with basic authentication. While running from Pega PRPC or SoapUI, we can find the respective places where we can enter the credentials.
But when I consumed the same service in Pega Robotic Studio, Under the Binding I could not find any properties as shown in your screenshot. Please find attached screenshot of my ServiceClient Properties form
How can we find those properties in serviceClient component to enter the username and password for the service. ? Do we need to use any other authentication other than Pega Basic authentication.?
Please advise.
***Edited by Moderator Marissa to update platform capability tags***
-
Like (0)
-
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689954000/f7151e69-7bd9-4702-be03-ebb6f0beb05f.jpg?itok=GWX3Wdig)
Could you please find the below link:
https://collaborate.pega.com/question/rest-services-using-serviceclient-component
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Hi Raveendra,
Thanks for your reply.
the link you shared was related to Rest service. I am looking for Soap Service and that too to find way to give credentials for basic authentication.
Thanks,
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
You can't use soap service directly in openspan so you have to write a wrapper in c#
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Hi Jayachandra,
if possible, could you please provide me sample Wrapper Code in C# that can invoke soap service with Basic Authentication.
Thanks,
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689954000/f7151e69-7bd9-4702-be03-ebb6f0beb05f.jpg?itok=GWX3Wdig)
Have you tried by using authentication profile.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Attached doc will help you to understand how to write wrapper in c# and consuming in automation. But this is not as per your requirement.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Hi Jayachandra,
Thanks for the sharing the document.
As per that It seems that we need to built the custom code to connect to SoapService (which uses Basic authentication) outside Pega Robotics i.e in Visual Studio , then convert that into dll file, which then needs to be imported to Pega Robotics Project as any other dll files.
Within Pega Robotics, I wrote below code. Everything is good except myService.Credentials .
compilation issue: 'ServiceClient' does not contain a definition for 'Credentials' and no extension method 'Credentials' accepting a first argument of type 'ServiceClient' could be found (are you missing a using directive or an assembly reference?)
****************************************************************************************
OpenSpan.ServiceEnablement.Client.ServiceClient myService = new OpenSpan.ServiceEnablement.Client.ServiceClient();
System.Net.CredentialCache myCredentials = new System.Net.CredentialCache();
NetworkCredential netCred = new NetworkCredential("username", "password");
myCredentials.Add(new Uri("SOAP Service EndPoint URL"), "Basic", netCred);
myService.PreAuthenticate = true;
myService.UseDefaultCredentials = false;
myService.Credentials = myCredentials;
************************************************************************************************************
Hi Jayachandra,
Thanks for the sharing the document.
As per that It seems that we need to built the custom code to connect to SoapService (which uses Basic authentication) outside Pega Robotics i.e in Visual Studio , then convert that into dll file, which then needs to be imported to Pega Robotics Project as any other dll files.
Within Pega Robotics, I wrote below code. Everything is good except myService.Credentials .
compilation issue: 'ServiceClient' does not contain a definition for 'Credentials' and no extension method 'Credentials' accepting a first argument of type 'ServiceClient' could be found (are you missing a using directive or an assembly reference?)
****************************************************************************************
OpenSpan.ServiceEnablement.Client.ServiceClient myService = new OpenSpan.ServiceEnablement.Client.ServiceClient();
System.Net.CredentialCache myCredentials = new System.Net.CredentialCache();
NetworkCredential netCred = new NetworkCredential("username", "password");
myCredentials.Add(new Uri("SOAP Service EndPoint URL"), "Basic", netCred);
myService.PreAuthenticate = true;
myService.UseDefaultCredentials = false;
myService.Credentials = myCredentials;
************************************************************************************************************
Please let me know if you have any idea about this way.
Thanks,
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Try as below.
myService.ClientCredentials.UserName.UserName = "username"; or myService.Credentials.UserName.UserName = "username";
myService.ClientCredentials.UserName.Password = "password"; or myService.Credentials.UserName.Password = "password";
This is generic and bit difficult to provide the answer without knowing the service properties.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Getting the similar compilation issue as below
**************************************************************************
Error 'ServiceClient' does not contain a definition for 'ClientCredentials' and no extension method 'ClientCredentials' accepting a first argument of type 'ServiceClient' could be found (are you missing a using directive or an assembly reference?)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Hi Gayatri,
do u mean the Authentication Profile in Pega PRPC, which is used to store the credentials ( username and password) for connecting to authenticated soap Service.?
Then in that case, you might be thinking that we are creating a connector in Pega PRPC application.
Please clarify your question.