cancel
Showing results for 
Search instead for 
Did you mean: 

Issues while calling HttpRequest

MáriaBojová
Level 3
Hello,

I am having issue while integrating REST API for DocuSign page. The HttpRequest  (also tried HttpWebRequest). From studio and vs code the code works fine, no issues. But while running from control room I am getting errors:

The underlying connection was closed: No trust could be established for the protected SSL / TLS channel.
The connection to the remote server can not be established.
Could not execute code stage because exception thrown by code stage: Unable to resolve the remote name: 'eu.docusign.net'
I can not figure out how is it possible. Same code runs from studio and does not run from control room on the same resource.

Thanks for your answers.

------------------------------
Maria Bojoa
PTP Process manager digitalization
Deutsche Telekom
Europe/Bratislava
------------------------------
10 REPLIES 10

AndreyKudinov
Level 10
This is strange indeed. Is vs and bp running under the same user? Check if firewall is blocking blueprism connections.

------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------

Hi Maria,

When you say it runs fine in studio, did you mean visual studio or Blue Prism Process studio. I'm assuming you mean Visual Studio, if so, 

Can you check if the certificates are installed correctly for the docusign url. Ensure the intermediate and root certificate authorities are recognized in the runtime resource where blueprism runs
One simple way to check this would be to open the docusign url (use the one configured in your blueprism process) in internet explorer on the runtime resource and check if there are https errors. In case there are no errors, then you are good to go.

Additionally, can you try adding the docusign IP address to your localhost. May be there are proxies in the Runtime resource network connection that is causing these blocks.

Thanks
Bimal

------------------------------
Bimal Sebastian
Consultant
Blueprism
Asia/Kolkata
------------------------------

Well It works from vs code and also from Blue Prism studio without any issues. It works now somehow also from control room but not always. I realized that restarting resource helps, but we have pool system so It is not ideal. I have workaround with rebooting resource and triggering another schedule, but  it does not solve the root cause.
I tried also to check url in the web browser several times, it seems to be working just fine.I still have no clue what is causing this issues.

Also HttpClient not working at all in control room (but it works in vs code and Blue Prism studio)
WebRequest is working as described above.I am using default proxy credentials, it made it work as least somehow.
😕


------------------------------
Mária Bojová
PTP Process manager digitalization
Deutsche Telekom
Europe/Bratislava
------------------------------

Hi Maria,

can you tell me what version of Blue prism is used here. Perhaps post the code here if you can
also, have you tried the web api feature in v6.3 which should make calling apis much more easier.


------------------------------
Bimal Sebastian
Consultant
Blueprism
Asia/Kolkata
------------------------------

Hi,

It is BP 6.4 version and the sample code is following:

ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

System.Net.ServicePointManager.ServerCertificateValidationCallback +=
(se, cert, chain, sslerror) =>
{return true;};
IWebProxy defaultWebProxy = WebRequest.DefaultWebProxy;
defaultWebProxy.Credentials = CredentialCache.DefaultCredentials;

var request = (HttpWebRequest)WebRequest.CreateHttp(loginEndpoint);
request.Headers.Add("X-DocuSign-Authentication", "{\"Username\":\"" + username + "\", \"Password\":\"" + password + "\", \"IntegratorKey\":\"" + integratorkey + "\"}");
request.Method = "GET";

HttpWebResponse resp = (HttpWebResponse)request.GetResponse();
Stream dataStream = resp.GetResponseStream ();
StreamReader reader = new StreamReader (dataStream);
JResponse= reader.ReadToEnd ();

status = resp.StatusCode.ToString();

------------------------------
Mária Bojová
PTP Process manager digitalization
Deutsche Telekom
Europe/Bratislava
------------------------------

Hi Maria,

the code does look fine to me. I guess reading the code and actually seeing it work after considering external impacts (ex: certificates...etc)
But, is there any reason you havent considered using the Web API feature of Blueprism.


------------------------------
Bimal Sebastian
Consultant
Blueprism
Asia/Kolkata
------------------------------

JoakimEklund
Level 6
Have you raised this to the target application/system owner? Perhaps they can see some something in the logs or provide input, it'd also be good to validate whether the connection between the client and application/system is stable.

Have you tried retrying the API calls when these exceptions occurs and not just throw the exception on first encounter?

/Joakim

------------------------------
Joakim Eklund
Senior RPA Developer
Swedbank AB
Europe/Stockholm
------------------------------

Subanisms
Level 2

I was facing the same issue. if you are using code stage just add this before the connection

ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;

Please refer : https://stackoverflow.com/questions/22627977/the-underlying-connection-was-closed-an-unexpected-error-occurred-on-a-send




------------------------------
Subani sms
------------------------------

Well It works from vs code and also from Blue Prism studio without any issues.

It works now somehow also from control room but not always.

I realized that restarting resource helps, but we have pool system so It is not ideal.

I have workaround with rebooting resource and triggering another schedule, but it does not solve the root cause.

I tried also to check url in the web browser several times,

it seems to be working just fine.

I still have no clue what is causing this issues.

Also HttpClient not working at all in control room (but it works in vs code and Blue Prism studio) WebRequest is working as described above.

I am using default proxy credentials,

it made it work as least somehow.
------------------------------
Hydro-Lazer
------------------------------