FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV 2024
→
Can;t connect to web service from Windev
Can;t connect to web service from Windev
Débuté par steve erts, 24 aoû. 2018 03:07 - 5 réponses
Connectez-vous…
steve erts
#1
Posté le 24 août 2018 - 03:07
Hi,
I've written a rest web service in windev 22 and have it installed and working on a clients server (server A). I've now installed it on second server (server
and am having some issues calling Server B it from my windev 22 desktop app.
When I do make a call I get "No server response. Check whether a HTPP server is present on the target server".
Oddly, I can successfully call the web service on Server B from webdev's browser based test tool and from browser code of a webdev AWP page, but NOT from the server code of same webdev page.
I am stumped. Here is code. Any ideas?
If any ones to try hitting below from Windev desktop feel free. That might at least rule out network related issues.
Thanks!
sURL is string
sURL="
https://rds.tourcube.net/tourcube/ping
"
sHTTPRequest is httpRequest
sHTTPRequest..Header["tc-api-key"] = "MTSTEST"
sHTTPRequest..URL=sURL
sHTTPRequest..Method=httpGet
cMyResponse is httpResponse = HTTPSend(sHTTPRequest)
IF ErrorOccurred THEN
Error(ErrorInfo(errFullDetails))
ELSE
Info(cMyResponse..Content)
END
Signaler
0
0
Art Bonds
#2
Posté le 24 août 2018 - 03:18
I get "access denied" when I copy/paste
https://rds.tourcube.net/tourcube/ping
into the address bar of a Firefox tab.
Signaler
0
0
steve erts
#3
Posté le 24 août 2018 - 03:25
That’s intentional.
There are headers required
Signaler
0
0
steve erts
#4
Posté le 24 août 2018 - 08:27
It looks like for some reason the server does not like the request as it's being sent by
sURL is string
sURL="
https://rds.tourcube.net/tourcube/ping
"
sHTTPRequest is httpRequest
sHTTPRequest..Header["tc-api-key"] = "MTSTEST"
sHTTPRequest..URL=sURL
sHTTPRequest..Method=httpGet
cMyResponse is httpResponse = HTTPSend(sHTTPRequest)
IF ErrorOccurred THEN
Error(ErrorInfo)
ELSE
Info(cMyResponse..Content)
END
b./c when I sent in the following manner it works
HTTPRequest("
https://rds.tourcube.net/tourcube/ping","","tc-api-key
: MTSTEST","","","","")
ResCode is string = HTTPGetResult()
Info(ResCode)
Does anyone have any ideas?
Signaler
0
0
steve erts
#5
Posté le 24 août 2018 - 18:25
The plot thickens..
I trapped my requests in Ngrok
This request from Fiddler works
GET / HTTP/1.1
tc-api-key: MTSTEST
User-Agent: Fiddler
Host:
https://rds.tourcube.net/tourcube/ping
X-Forwarded-For: 97.115.112.236
but this one from Windev does not
GET / HTTP/1.1
Host: e0da3aa0.ngrok.io
User-Agent: Tourcube
Accept: */*
Connection: close
tc-api-key: MTSTEST
X-Forwarded-For: 97.115.112.236
maybe something about "Accept" and "Connection" that Server B does not like. Oddly my HTPP Response Headers in IIS are same on both servers.
Signaler
0
0
steve erts
#6
Posté le 24 août 2018 - 20:33
The second server was kind of old and did not support TLS 1.2
when I added sHTTPRequest..VersionSSL=ProtocolTLS1 it fixed issue.
Now to get that server upgraded
Signaler
0
0
→ Revenir à WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte