C# Core HttpClient is not working but RestClient (from RestSharp) works - httpclient

I have API hosted in IIS . I have two client in OpensHift docker container . One client is using RestSharp RestClient to access the API from Openshift , it works . But 2nd client , which uses HttpClient get always response code 503 Service Uunavailable. Any hint to fix this ?

Related

Zuul routes redirect issue in chrome browser

I have deployed one application on GKE GCP
Front end is in
Angular and backend is spring boot with version 2.6.7 and spring
clound version 2021.0.5. The flows goes from front end to backend and
in the backend Zuul gateway will redirect the request to the different
server which is on-prem. The application is getting successful
response from the on-prem server on the edge browser but in the chrome
browser it is failing. We have checked the on-prem server logs, extra
https is getting added in the API url when we are hitting the
application url in the chrome browser. The same extra https is not
getting added when we are hitting it from the edge browser. The error
stack from the on-prem server is given below.
java.lang.IllegalStateException: Could not get HttpServletRequest URI: Illegal character in scheme name at index 5: https,https://<IP>/abc/def/xyz
at org.springframework.http.server.ServletServerHttpRequest.getURI(ServletServerHttpRequest.java:99) ~[spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.web.util.UriComponentsBuilder.fromHttpRequest(UriComponentsBuilder.java:282) ~[spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE]
at org.springframework.web.util.WebUtils.isSameOrigin(WebUtils.java:814) ~[spring-web-4.2.5.RELEASE.jar:4.2.5.RELEASE]
Has anyone else also faced similar kind of issue?

Localhost Spring Boot service not found

I am studying Spring Cloud and I am developing a study project.
I create a project that represents a simple REST API using Spring Boot and I run this in localhost.
I also created another project API Gateway, this one gets the request coming and calls the REST API, I am also running this one in localhost.
When I run the REST API and send a request to it, it responds properly, but if I send the request to API Gateway when API Gateway tries to call the REST API using RestTemplate it is getting this exception:
java.lang.IllegalStateException: No instances available for localhost
Both services are running in localhost.
Do anyone knows what is the cause of this error?

docusign php soap error could not connect to host in APIService.php usiing https

I am using docusign soap api using php. when I am using url https://demo.docusign.net/api/3.0/api.asmx it is working fine, Now I live API key and using https://docusign.net/api/3.0/api.asmx, it is not working, got error - could not connect to host in APIService.php. but if i use http://docusign.net/api/3.0/api.asmx (not https) then it is working fine. Can you please tell me why we getting error when using https?
You need the sub-domain of the production server. The HTTP to HTTPS redirect is masking your issue
ex:
https://na2.docusign.net/api/3.0/api.asmx

Can my Web Server Issue a Client Rest Request to another REST Server

I have a web server that handles configuration set-up for various IO devices. I need to get some data from a REST server that is running on a different server. Can that web server code issue a client REST GET command to a REST server running on a different server? I tried it but I get a http 500 error. The server code is failing on the REST server request code.
I am closing out this question. Yes, your server can issue http requests to other services. I was having another problem with a self-signed certificate and the error made it look like their was a problem with my http request service.

Using Kong API Gateway as a proxy for Cisco UCCX

I am running Cisco UCCX 11.0 which is a Contact Center server that is based on a Java scripting engine. Scripts are build using the 'Script Editor' software where you drag elements (Java Beans) to define the script logic. One of the steps in the script is to perform a REST Call. Unfortunately this step does not support adding Custom Headers such as Authorization headers and thus is limited to Basic Authentication only.
I would like the script to make a REST Call to an external API that uses a static Bearer Token. Am I correct in saying I could use Kong Gateway for this? Here is my idea of the flow:
UCCX Makes REST Call to Kong with Basic Authentication ---> Kong Gateway recieves the request ---> Kong Gateway makes it's request to External API with static Bearer Token ---> External API responds back to Kong ---> Kong forwards the Response back to UCCX
Is this type of flow possible/easy to deploy?
This can easily be managed by assigning the Request Transformer plugin to the Kong API exposing the upstream service.
Example:
Let's assume you have an API endpoint on Kong called /myapi that is forwarding to your upstream service.
You then assign the Request Transformer plugin to the /myapi API.
For your case, you will most likely want to be using the config.add.headers option when configuring the Request Transformer plugin to add the required header authentication which will be added to all upstream requests.
Relevant Gitter Conversation:
https://gitter.im/Mashape/kong?at=587c3a9c074f7be763d686db