Question
1986
US
Last activity: 27 Aug 2018 10:20 EDT
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)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Adaps
IN
Could you please find the below link:
https://collaborate.pega.com/question/rest-services-using-serviceclient-component
-
Piyush Tiwari
1986
US
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,
Infosys
IN
You can't use soap service directly in openspan so you have to write a wrapper in c#
1986
US
Hi Jayachandra,
if possible, could you please provide me sample Wrapper Code in C# that can invoke soap service with Basic Authentication.
Thanks,
Adaps
IN
Have you tried by using authentication profile.
-
Abhishek Biswas
Infosys
IN
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.
1986
US
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,
Infosys
IN
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.
1986
US
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?)
CollabPartnerz
IN
Are you using authentication profile?
1986
US
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.
CollabPartnerz
IN
No not connector,my idea is are you using any security profile (ex: WS security) in service soap?
1986
US
No.. I am not using any security profile rule.
-
Anand Chouti Narsi Vulisetti